axiom-developer
[Top][All Lists]
Advanced

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

[Axiom-developer] Unions in Spad


From: Stephen Wilson
Subject: [Axiom-developer] Unions in Spad
Date: 08 Jul 2007 15:21:52 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

*,

During my work figuring out the defintrf.spad bug, I noticed a
shortcoming in the handling of unions.

Spad, internally, has two notions of Unions.  The first variety might
be termed `regular', the other is, not surprisingly, termed `new'.

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)

The shortcoming is how these two flavors interact.  Currently, Unions
are of one kind or the other.  But this fact is nowhere asserted, and
blending the two types leads to obscure errors.  For example:

     Union(int: Integer, String)

I would appreciate any input if the above `hybrid' Union is useful or
desirable.

If so, I have a strategy to make such Unions usable (but it may be a
while before I find the time to implement it). If not, then there is
an easy fix to assert the uniformity of Union branches.


Thanks,
Steve





reply via email to

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