[bitc-dev] Type Alias Specification (Correction)
swaroop at cs.jhu.edu
Sun Jan 16 00:39:47 EST 2005
Swaroop Sridhar wrote:
>(typealias sametype (lambda 'a 'a))
>should work just fine.
Well, this will not always work fine. It will work fine only if x is
defined at top level, and is thus overloaded.
What I intended to write is:
will work just fine. The point is that second use of sametype will still
have the original meaning and will work fine.
(Please read the previous mail for details)
However, there is a concern about programmer perception that I want to
(x:(lambda ((mutable sametype), sametype) sametype) (lambda (a,
b) (set! a b)))
(y:sametype (lambda a a))
(z:sametype (lambda a a))
(p (y 1))
(q (z true))
(x (mutable y) z) ; WRONG!
This kind of a thing may confuse the programmer. This is also the reason I
preferred to report fully expanded types.
This is also probably reason enough, not to have typealiases.
More information about the bitc-dev