"Bill Page" <[EMAIL PROTECTED]> writes:
> If I define:
>
> Foo(op:Symbol,A:Type):Category == with op:(%,%)->A
>
> What do expect a domain
>
> Bar():Foo('+,Integer)
>
> to export?
a single operation named "op"
> What do you expect to occur on the left side of the : in a declaration?
>
> x:y
>
> It seems to me that x must be a symbol. No?
No, x is an identifier, whose type is y, and who hasn't yet been given a value.
> In Axiom symbols are values of the domain Symbol.
Yes, but x is not a symbol. It is only a convenience (perhaps an unfortunate
one) for the user that in the Axiom interpreter, every symbol-like literal is
interpreted as an identifier of type Symbol with value being it's name. (I
believe that sage does not do that:
[EMAIL PROTECTED]:~$ sage
----------------------------------------------------------------------
| SAGE Version 3.0.2, Release Date: 2008-05-24 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
Loading SAGE library. Current Mercurial branch is: combinat
sage: a
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
/home/martin/<ipython console> in <module>()
NameError: name 'a' is not defined
This distinction between identifiers and values makes programming much easier
and less error-prone.
Unfortunately, Axiom does not support overloading of constants in the
interpreter (in fact, there is no such thing as a constant), but in Aldor I can
nicely illustrate what I mean:
[EMAIL PROTECTED]:~$ aldor -gloop
AA L DDDD OOO RRRR
A A L D D O O R R
A A L D D O O R R
AAAAA L D D O O RRRR
A A L D D O O R R
A A LLLLL DDDD OOO R R
(c) Numerical Algorithms Group Ltd 1995-2001
Release: Aldor(C) version 1.0.3 for LINUX(glibc2.3)
Type "#int help" for more details.
%1 >> #include "aldor"
Comp: 70 msec, Interp: 20 msec
%2 >> #include "aldorinterp"
Comp: 20 msec, Interp: 0 msec
%3 >> x: Integer == 1
Defined x @ AldorInteger
Comp: 20 msec, Interp: 10 msec
%4 >> x: Symbol == new()
Defined x @ Symbol
Comp: 0 msec, Interp: 80 msec
%5 >> [EMAIL PROTECTED]
%v1 @ Symbol
Comp: 0 msec, Interp: 20 msec
%6 >> [EMAIL PROTECTED]
1 @ AldorInteger
Comp: 0 msec, Interp: 0 msec
Martin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---