For my Interpreter, oh, I plan on having a Subroutine "Call Subname;arg1;arg2;arg3..."
For Functions I will have a Function Func[functionName, arg1, arg2, arg3]
Both the Call routine and the Func[ ] function will lookup the 1st argument which is block name for lines of code to execute the sub or function. So in a recursive call to my code executer something like Run( codeblock$, parameters$) will split the codeblock$ out to string array of program lines and split parameters$ string to string array of arguments to which matching values will be assigned from the actual call or Func[] call. I also probably will have to store the variable table for current code block on stack before call and pull it down again and update byref variables in that variable table before exit the sub or function call. Shared variables? probably need a separate SHARED variable table and consult that first when checking variable assignments.
Got all that? Tricky as hell I've been thinking off and on about it for 2 years!
For Functions I will have a Function Func[functionName, arg1, arg2, arg3]
Both the Call routine and the Func[ ] function will lookup the 1st argument which is block name for lines of code to execute the sub or function. So in a recursive call to my code executer something like Run( codeblock$, parameters$) will split the codeblock$ out to string array of program lines and split parameters$ string to string array of arguments to which matching values will be assigned from the actual call or Func[] call. I also probably will have to store the variable table for current code block on stack before call and pull it down again and update byref variables in that variable table before exit the sub or function call. Shared variables? probably need a separate SHARED variable table and consult that first when checking variable assignments.
Got all that? Tricky as hell I've been thinking off and on about it for 2 years!
b = b + ...