I am using FriCAS 1.3.2. The following nested function compiles and runs ok
1
2 --length2 : List(Any) -> INT
3 --leng_aux : (INT, List(Any)) -> INT
4
5 length2 (l) ==
6
7 leng_aux (count , l2 ) ==
8 if l2 = [] then count
9 else leng_aux (count+1, rest(l2))
10
11 leng_aux (0, l)
If I uncomment lines 2 and 3, the )read is ok, but executing
length2 [1,2,3]
I get
length2 [1,2,3]
Compiled code for length2 has been cleared.
1 old definition(s) deleted for function or rule leng_aux
Compiling function leng_aux with type (Integer, List(Any)) ->
Integer
Compiling function length2 with type List(Any) -> Integer
There are no library operations named length2
If I now recomment lines 2 and 3 and do a )read and execute
length2 [1,2,3]
-> length2 [1,2,3]
Compiled code for leng_aux has been cleared.
Compiled code for length2 has been cleared.
1 old definition(s) deleted for function or rule leng_aux
Compiling function leng_aux with type (Integer, List(Any)) ->
Integer
Compiling function length2 with type List(Any) -> Integer
There are no library operations named length2
--
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 https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.