Menu

#31 Recursive funs do not work correctly

open
None
5
2007-10-02
2007-10-02
No

There is an issue with recursive functions using the fun syntax, e.g.

;-) fun recurse( n ) => recurse( n ); endfun;
MISHAP : Could not find the definition for this variable
NAME : recurse
ORIGIN : origin
LINE NO. : 1
PHASE : Compile
Resetting input and resuming execution

This occurs because no variable with the name "recurse" exists inside the body of the function.

We should consider inserting an automatic local variable with the function name, bound to the function. This should be handled in a similar way to the functions arguments.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.