Re: Pattern Matching

hannah@schlund.de (Hannah Schroeter)
19 May 2005 21:44:45 -0400

          From comp.compilers

Related articles
pattern matching aldeeran@tin.it (alderaan) (2003-11-21)
Re: pattern matching basile-news@starynkevitch.net (Basile STARYNKEVITCH) (2003-12-03)
Pattern Matching tommy.nordgren@chello.se (2005-03-04)
Re: Pattern Matching hannah@schlund.de (2005-05-19)
| List of all articles for this month |

From: hannah@schlund.de (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

Hello!


  <tommy.nordgren@chello.se> 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.


>endclass;


>[... 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,


Hannah.



Post a followup to this message

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