[Aldor-l] Special casing...

Gabriel Dos Reis gdr at cs.tamu.edu
Fri Feb 16 18:19:02 EST 2007


Martin Rubey <martin.rubey at univie.ac.at> writes:

| Dear Christian, Dear Gaby,
| 
| do you think that something like (i.e., achieving the same or a similar effect
| as) the following is possible in Aldor (or in improved SPAD):
| 
| I'd like the compiler to allow something like
| 
| ---------------------------------------------------------------------------
| f(a: S): T == { generic implementation }
| 
| f(specialValueOfTypeS): T == { special implementation for specialValueOfTypeS }
| f(otherSpecialValueOfTypeS): T == { special imp. for otherSpecialValueOfTypeS }
| 
| g(c: T, d: T): T == { ... f(c) ... f(d) ...}
| ---------------------------------------------------------------------------
| 
| So, if c happens to be specialValueOfTypeS, then the special implementation is
| used, and so on.

I believe the Axiom interpreter and compiler internal representation
is prepared to handle something like that.  However, I don't know
whether the algorithms for type ckecing and all that are prepared to
do so.

-- Gaby



More information about the Aldor-l mailing list