Ralf Hemmecke <[EMAIL PROTECTED]> writes: > Hello Stephen, > > > Regular Unions do not have tags associated with branches. For example: > > Union(Integer, String) > > New Unions have tags, as in > > Union(int: Integer, str: String) > > SPAD seems to allow > > u: Union(Integer, String) := ... > if u case Integer then ... > > I am not aware of the fact that Aldor can do this. And in the Aldor > User Guide I have only found tagged unions. > > How does now actually distinguish branches. My code above was actually > only a guess. I have no idea whether that works in SPAD. In Aldor it > doesn't.
Your correct that this would work in Spad. I have not tried to get any insight from Aldor yet. I seem to recall that Aldor's handling of these types is somewhat broken, too. But I think Aldor's treatment of selectors as elements of type Enumeration is worth looking at and possibly worth making explicit in Spad. Spad seems to follow similar semantics conceptually but I cant see the direct connection to the type system at this time. Thanks, Steve _______________________________________________ Axiom-developer mailing list Axiom-developer@nongnu.org http://lists.nongnu.org/mailman/listinfo/axiom-developer