call_actions= LYMB statements Sets the body of the procedure. This is where you do the work. If you need to create global objects, use the enable_globals! method of msg.
call! Executes the body of the procedure.
call:(arg1, arg2,...) A combination of in_args= and call!. Calls the arg_procedure with the arguments specified.
meta_call:(arg1,arg2,...) Just like call: except that the first argument is assumed to be an object. A reference to this object is created and called self. This argument is not included in the in_args. This method is primarily used by metaclasses.
return_value=(val1,val2,...) associates a list of values with the return value of the procedure. These can be set from anywhere, although they will most often be set from inside the procedure's call_actions.
return_value? returns the current return value(s) of the procedure.
arg_procedure new: `fact' call_actions=`
/* create some local variables */ scalar new: `i'; scalar new: `temp'; logic new: `l1'; loop new: `loop1'; arg_vector new: `results';
loop1 resolution= 1 duration= [args dimension?] tick_actions= ` i = [args @ [temp = [loop1 time?] + 1 ?] scalar_args?]; l1 less:(i,2) false:` i - 1; fact call: i; i + 1; i * [fact return_value?]; results components+ i; ' true:` results components+ 1; ' ; ' start! ;
/* now set the return values */ fact return_value= [results components?]; ' ;
fact call: (1,2,3,4,5) print: return_value;