[bitc-dev] Type Alias Specification (Correction)

Swaroop Sridhar swaroop at cs.jhu.edu
Sun Jan 16 00:39:47 EST 2005


Swaroop Sridhar wrote:

>
>ex:
>(typealias sametype (lambda 'a 'a))
>
>(x:sametype 1)
>(x:sametype true)
>
>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:

(x:sametype 1)
(y:sametype true)

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
address here.
(let*  (
          (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.

Swaroop.




More information about the bitc-dev mailing list