Re: Pattern Matching (Hannah Schroeter)
19 May 2005 21:44:45 -0400

          From comp.compilers

Related articles
pattern matching (alderaan) (2003-11-21)
Re: pattern matching (Basile STARYNKEVITCH) (2003-12-03)
Pattern Matching (2005-03-04)
Re: Pattern Matching (2005-05-19)
| List of all articles for this month |

From: (Hannah Schroeter)
Newsgroups: comp.compilers
Date: 19 May 2005 21:44:45 -0400
Organization: Schlund + Partner AG
References: 05-03-023
Keywords: design
Posted-Date: 19 May 2005 21:44:45 EDT


  <> wrote:
>I am interested in implementing an interactive fiction language as a hobby
>project. My language will have methods declared as follows: class myClass:
>baseclasses myMethod(a _ omeClass,b _ SomeOtherClass)_ ReturnType = block

>myMethod(a _ AlfaClass,b _ BetaClass)_ ReturnType = block.


>[... method dispatch on the run-time type of more than one argument ...]

Something very similar is done by CLOS, the standard object system of
ANSI Common Lisp. You could look for their implementation techniques,
e.g. for the (IIRC public domain) implementation PCL, which is used,
with variation, both in some native-compiled Common Lisp implementations
(CMUCL, SBCL), as well as in byte-compiled implementations (GNU Clisp).

CLOS also includes dispatch on identity of a specific single object,
and specializations like this are seen as more specific than
specializations on a class type.

Kind regards,


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.