|pattern matching firstname.lastname@example.org (alderaan) (2003-11-21)|
|Re: pattern matching email@example.com (Basile STARYNKEVITCH) (2003-12-03)|
|Pattern Matching firstname.lastname@example.org (2005-03-04)|
|Re: Pattern Matching email@example.com (2005-05-19)|
|From:||firstname.lastname@example.org (Hannah Schroeter)|
|Date:||19 May 2005 21:44:45 -0400|
|Organization:||Schlund + Partner AG|
|Posted-Date:||19 May 2005 21:44:45 EDT|
>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.
Return to the
Search the comp.compilers archives again.