I'm anyway for always declaring the type of the function.
It seems that you try to develop some code in .input files. That's OK,
to save retyping certain expressions into the interpreter. However, I
strongly suggest that you develop bigger code by writing a package in a
.spad file.
Maybe that's only my opinion, but when I started with AXIOM, I became
frustrated rather soon, since the interpreter coerced to another type
than I thought the computation would run and things became complicated
to debug. Switching to SPAD helped, because the compiler rejects
type-unsafe code. Yes, that's a bit more typing, but in the end avoids
needless debugging.
Ralf
(1) -> N==>PositiveInteger; Z==>Integer
Type:
Void
(2) -> f(1)==1
Type:
Void
(3) -> f(x:N):N == x*f((x::Z-1)::N)
Function declaration f : PositiveInteger -> PositiveInteger has been
added to workspace.
Type:
Void
(4) -> f(2)
Compiling function f with type PositiveInteger -> PositiveInteger
(4) 2
Type:
PositiveInteger
(5) -> f(n)
Conversion failed in the compiled user function f .
Cannot convert the value from type Symbol to PositiveInteger .
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.