axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Unions in Spad


From: Stephen Wilson
Subject: Re: [Axiom-developer] Unions in Spad
Date: 11 Jul 2007 12:01:29 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Bill, Waldek,

Thank you both for your replies!

I think the consensus is that `hybrid' Union types are not desirable.
Consequently, I will look into making Spad strictly enforce this.  In
addition, the constraint that an untagged Union not have identically
typed branches, and that in the tagged case all branch names are
distinct.

"Bill Page" <address@hidden> writes:
[...]
> Thinking out load: Perhaps this use of ':' should be given explict
> operator semantics so that it could be considered as just a pretty
> form of type constructor, e.g.
> 
>   Keyword(x:Symbol,T:Type): ... with KeywordCategory ...
>     == T add ...
> 
> (not withstanding that it's usage here is recursive). Then as a type
> it would be easy to insist that a parameter to a constructor be of
> this type by requiring KeywordCategory.
> 
> Does this make sense?

If we were to support keyword arguments, the binding of arguments
would need to be part of the type.  I believe that what you are
suggesting is essentially how one one would need to view `x : T' when
implementing the facility.


Sincerely,
Steve





reply via email to

[Prev in Thread] Current Thread [Next in Thread]