"Bill Page" <[EMAIL PROTECTED]> writes:

[...]

| Question:
| 
| 1) What happens if there is more that one Tuple or another type of
| argument in the argument list? E.g.
| 
|      TupleDom(sym: Tuple Symbol, str:String, int: Tuple Integer):
| Public == Private where
| 
| 2) Can I write something like?
| 
|     MyDom := TupleDom( (x,y,z,w,u), "test", (1,2,3,4,5))
| 
|     or do I still need to use [x,y,z ... ] ?

This continues to work as before the patch -- the patch should be
orthogonal to this case.

| 
| 3) Can I use Tuple in a similar manner when calling a function? E.g.
| 
|     t(x:Tuple PI):INT == length(x)
| 
|     t(1,2,3)
| 
| instead of?
| 
|    t([1,2,3])

The patch is orthogonal to this case -- the patch deals specifically with
instantiating Tuple-like constructors, not call to general functions.

| Comments:
| 
| 1) Besides 'Tuple', would it also be possible to treat 'Record' and
| 'Union' this way? E.g.
| 
|      RecDom(arg:Record(sym: Symbol, str:String, int: Integer)): Public
| == Private where
| 
|          if arg.sym=x and arg.str="x" or arg.int=0 then ...
| 
|     MyDom := RecDom(x,"x",1)

In principle, treating Record this way should be possible when we have
a type name for 'x: T'.  Also, to make it fully work, one needs to
modify the compiler too -- my patch modifies only the interpreter.

| ----------
| 
|      UnionDom(arg:Union(sym: Symbol, str:String, int: Integer)):
| Public == Private where
| 
|          if arg case sym  then ...
| 
|     MyDom := UnionDom("x")

The case of Union is harder.  The reason is that constructors cannot
not be overloaded.  Union is overloaded.

You did not ask for Mapping, but one should be able to have it for
Mapping -- in fact, it was working on something related to Mapping
(modemaps) that prompted me to add the capability.

-- Gaby

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel

Reply via email to