Comments
Loading Dream Comments...
You must be logged in to write a comment - Log In
Consider the function call {Foo ("yay", 42, "squee");}
Given that a ::SHE+ILA:: parameter list is a Buf, we can actually construct a parameter list at runtime using the standard FBI opcodes (FBI=Fundamental Buffer Interface), for example:
{List <:: "yay"; List << 42; List << "squee"; Foo List;}
A variable number of parameters can be passed, as the function Foo can get the parameter list count using the # operator, for example:
Foo <:: [](parm){
count <:: #parm; i <:: 1;
{* i.le.count : ttyout(parm[i++]); *}; }
This uses i as a subscript into the parameter list and loops while i is less than or equal to the number of parameters, calling ttyout for each parameter. (Remember that ::SHE+ILA:: is an Origin 1 language, so indices start at 1, as we use slot 0 as the symbol table.)