This fails in SPAD:
spad
)abbrev domain AAA Aaa
Aaa: with
bar: Integer -> Integer
== add
foo(x:Float):Integer == 1
foo(x:Integer):Integer == 2
a:Integer == 1
a:Float == 1.0
x:Integer := 1
y:Float := 1.0
bar(z:Integer):Integer == foo(x)+foo(y)
spad
Compiling FriCAS source code from file
/var/zope2/var/LatexWiki/162293060307836856-25px001.spad using
old system compiler.
AAA abbreviates domain Aaa
------------------------------------------------------------------------
initializing NRLIB AAA for Aaa
compiling into NRLIB AAA
compiling local foo : Float -> Integer
AAA;foo is replaced by 1
Time: 0.06 SEC.
compiling local foo : Integer -> Integer
AAA;foo is replaced by 2
Time: 0 SEC.
compiling local a : () -> Integer
AAA;a is replaced by 1
Time: 0 SEC.
compiling local a : () -> Float
Time: 0 SEC.
compiling exported bar : Integer -> Integer
****** comp fails at level 3 with expression: ******
error in function bar
(+ (|foo| |x|) (|foo| | << y >> |))
****** level 3 ******
$x:= y
$m:= (Integer)
$f:=
((((|z| # #) (|y| # #) (* # # #) (** # # #) ...) ((|foo| #))
((|foo| #) (* # # #) (** # # #) (+ # #) ...)))
>> Apparent user error:
Cannot coerce y
of mode (Float)
to mode (Integer)
axiom
bar(3)
There are no library operations named bar
Use HyperDoc Browse or issue
)what op bar
to learn if there is any operation containing " bar " in its
name.
Cannot find a definition or applicable library operation named bar
with argument type(s)
PositiveInteger
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need.
spad
)abbrev domain AAA0 Aaa0
Aaa0: with
bar0: Integer -> Integer
foo: Integer -> Integer
foo: Float -> Integer
== add
foo(x:Float):Integer == 1
foo(x:Integer):Integer == 2
x:Integer := 1
y:Float := 1.0
bar0(z:Integer):Integer == foo(x)+foo(y)
spad
Compiling FriCAS source code from file
/var/zope2/var/LatexWiki/6395014362195898863-25px003.spad using
old system compiler.
AAA0 abbreviates domain Aaa0
------------------------------------------------------------------------
initializing NRLIB AAA0 for Aaa0
compiling into NRLIB AAA0
compiling exported foo : Float -> Integer
AAA0;foo;FI;1 is replaced by 1
Time: 0.01 SEC.
compiling exported foo : Integer -> Integer
AAA0;foo;2I;2 is replaced by 2
Time: 0 SEC.
compiling exported bar0 : Integer -> Integer
Time: 0 SEC.
(time taken in buildFunctor: 0)
;;; *** |Aaa0| REDEFINED
;;; *** |Aaa0| REDEFINED
Time: 0 SEC.
Cumulative Statistics for Constructor Aaa0
Time: 0.01 seconds
finalizing NRLIB AAA0
Processing Aaa0 for Browser database:
--->-->Aaa0((bar0 ((Integer) (Integer)))): Not documented!!!!
--->-->Aaa0((foo ((Integer) (Integer)))): Not documented!!!!
--->-->Aaa0((foo ((Integer) (Float)))): Not documented!!!!
--->-->Aaa0(constructor): Not documented!!!!
--->-->Aaa0(): Missing Description
------------------------------------------------------------------------
Aaa0 is now explicitly exposed in frame initial
Aaa0 will be automatically loaded when needed from
/var/zope2/var/LatexWiki/AAA0.NRLIB/code
axiom
bar0(3)
But it works in Aldor:
aldor
#pile
#include "axiom"
Bbb: with
bar2: Integer -> Integer
== add
foo(x:Float):Integer == 1
foo(x:Integer):Integer == 2
a:Integer == 1
a:Float == 1.0
x:Integer := 1
y:Float := 1.0
bar2(z:Integer):Integer == foo(x)+foo(y)
aldor
Compiling FriCAS source code from file
/var/zope2/var/LatexWiki/3603377070621137033-25px005.as using
AXIOM-XL compiler and options
-O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom -Y $AXIOM/algebra
Use the system command )set compiler args to change these
options.
#1 (Warning) Deprecated message prefix: use `ALDOR_' instead of `_AXL'
Compiling Lisp source code from file
./3603377070621137033-25px005.lsp
Issuing )library command for 3603377070621137033-25px005
Reading /var/zope2/var/LatexWiki/3603377070621137033-25px005.asy
Bbb is now explicitly exposed in frame initial
Bbb will be automatically loaded when needed from
/var/zope2/var/LatexWiki/3603377070621137033-25px005
axiom
bar2(3)
aldor
#pile
#include "axiom"
Ccc: with
bar3: Integer -> Integer
== add
foo(x:Float):Integer == 1
foo(x:Integer):Integer == 2
a:Integer == 1
a:Float == 1.0
x:Integer := 1
y:Float := 1.0
bar3(z:Integer):Integer == foo(a)+foo(a)
aldor
Compiling FriCAS source code from file
/var/zope2/var/LatexWiki/2796111966566536169-25px007.as using
AXIOM-XL compiler and options
-O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom -Y $AXIOM/algebra
Use the system command )set compiler args to change these
options.
#1 (Warning) Deprecated message prefix: use `ALDOR_' instead of `_AXL'
"/var/zope2/var/LatexWiki/2796111966566536169-25px007.as", line 13:
bar3(z:Integer):Integer == foo(a)+foo(a)
...............................^......^
[L13 C32] #2 (Error) There are 2 meanings for the operator `foo'.
Meaning 1: (x: Float) -> Integer
Meaning 2: (x: Integer) -> Integer
The )library system command was not called after compilation.
axiom
bar3(3)
There are no library operations named bar3
Use HyperDoc Browse or issue
)what op bar3
to learn if there is any operation containing " bar3 " in its
name.
Cannot find a definition or applicable library operation named bar3
with argument type(s)
PositiveInteger
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need.
aldor
#pile
#include "axiom"
Ddd: with
bar4: Integer -> Integer
== add
foo(x:Float):Integer == 1
foo(x:Integer):Integer == 2
a:Integer == 1
a:Float == 1.0
x:Integer := 1
y:Float := 1.0
bar4(z:Integer):Integer == foo(a@Integer)+foo(a@Float)
aldor
Compiling FriCAS source code from file
/var/zope2/var/LatexWiki/8356965697444416280-25px009.as using
AXIOM-XL compiler and options
-O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom -Y $AXIOM/algebra
Use the system command )set compiler args to change these
options.
#1 (Warning) Deprecated message prefix: use `ALDOR_' instead of `_AXL'
Compiling Lisp source code from file
./8356965697444416280-25px009.lsp
Issuing )library command for 8356965697444416280-25px009
Reading /var/zope2/var/LatexWiki/8356965697444416280-25px009.asy
Ddd is now explicitly exposed in frame initial
Ddd will be automatically loaded when needed from
/var/zope2/var/LatexWiki/8356965697444416280-25px009
axiom
bar4(4)
aldor
#pile
#include "axiom"
Eee: with
bar5: Integer -> Integer
== add
foo(x:Tuple Integer):Integer == 1
foo(x:Integer,y:Integer):Integer == 2
bar5(z:Integer):Integer == foo(1)+foo(1,2)+foo(1,2,3)
aldor
Compiling FriCAS source code from file
/var/zope2/var/LatexWiki/7154599798421986088-25px011.as using
AXIOM-XL compiler and options
-O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom -Y $AXIOM/algebra
Use the system command )set compiler args to change these
options.
#1 (Warning) Deprecated message prefix: use `ALDOR_' instead of `_AXL'
"/var/zope2/var/LatexWiki/7154599798421986088-25px011.as", line 9:
bar5(z:Integer):Integer == foo(1)+foo(1,2)+foo(1,2,3)
......................................^
[L9 C39] #2 (Error) There are 2 meanings for the operator `foo'.
Meaning 1: (x: Tuple(Integer)) -> Integer
Meaning 2: (x: Integer, y: Integer) -> Integer
The )library system command was not called after compilation.
axiom
bar5(1)
There are no library operations named bar5
Use HyperDoc Browse or issue
)what op bar5
to learn if there is any operation containing " bar5 " in its
name.
Cannot find a definition or applicable library operation named bar5
with argument type(s)
PositiveInteger
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need.
In SPAD a reference to #1, #2, in an expression denotes an
anonymous function. E.g.
#1 + #1 is the same as writing:
x +-> x + x
spad
)abbrev domain FFF Fff
Fff: with
bar7: () -> (Integer -> Integer)
bar8: () -> ((Integer,Integer) -> Integer)
== add
bar7 == #1 + #1
bar8 == (#1 * #1) + (#2 * #2)
spad
Compiling FriCAS source code from file
/var/zope2/var/LatexWiki/712240775020227376-25px013.spad using
old system compiler.
FFF abbreviates domain Fff
------------------------------------------------------------------------
initializing NRLIB FFF for Fff
compiling into NRLIB FFF
compiling exported bar7 : () -> Integer -> Integer
Time: 0 SEC.
compiling exported bar8 : () -> (Integer,Integer) -> Integer
Time: 0 SEC.
(time taken in buildFunctor: 0)
;;; *** |Fff| REDEFINED
;;; *** |Fff| REDEFINED
Time: 0 SEC.
Cumulative Statistics for Constructor Fff
Time: 0 seconds
finalizing NRLIB FFF
Processing Fff for Browser database:
--->-->Fff((bar7 ((Mapping (Integer) (Integer))))): Not documented!!!!
--->-->Fff((bar8 ((Mapping (Integer) (Integer) (Integer))))): Not documented!!!!
--->-->Fff(constructor): Not documented!!!!
--->-->Fff(): Missing Description
------------------------------------------------------------------------
Fff is now explicitly exposed in frame initial
Fff will be automatically loaded when needed from
/var/zope2/var/LatexWiki/FFF.NRLIB/code
axiom
bar7()(3)
axiom
bar7x() == x +-> x + x
Type: Void
axiom
bar7x()(3)
axiom
Compiling function bar7x with type () -> AnonymousFunction
axiom
bar8()(3,4)
axiom
bar8x() == (x,y) +-> x*x + y*y
Type: Void
axiom
bar8x()(3,4)
axiom
Compiling function bar8x with type () -> AnonymousFunction