return a procedure of n arguments with formal parameters p i (each p i is a parameter specification, i.e. either an identifier, or parameter modifier followed by an identifier)
proc([p 1 , p 2 , . . . , p n ]) body
return a procedure that takes at least n arguments. When it is called with more than n arguments, the excess arguments are placed in a list which is then passed as the argument to p rest
proc(p 1 , . . . , p n . p rest ) body
return a procedure that may take any number of arguments (including zero). When this procedure is called, all of the supplied arguments are placed in a list which is passed to the named parameter.
proc id body
Procedure Calls:
Function calls are denoted by the function expression followed immediately by a sequence of comma-separated argument expressions enclosed in parentheses. The following expressions are all legal function calls: f(a, b), g(), (foo(3))(a, b, c, d), (proc(n) n * 4)(2). Functions may be declared with a variable number of arguments, but in all cases, it is an error to call a function with fewer or more arguments than is permitted by the function’s declaration.
This does not include built-in procedure functionality.
Add procedures to SMPL.
Operations:
return a procedure of n arguments with formal parameters p i (each p i is a parameter specification, i.e. either an identifier, or parameter modifier followed by an identifier)
proc([p 1 , p 2 , . . . , p n ]) body
return a procedure that takes at least n arguments. When it is called with more than n arguments, the excess arguments are placed in a list which is then passed as the argument to p rest
proc(p 1 , . . . , p n . p rest ) body
return a procedure that may take any number of arguments (including zero). When this procedure is called, all of the supplied arguments are placed in a list which is passed to the named parameter.
proc id body
Procedure Calls: Function calls are denoted by the function expression followed immediately by a sequence of comma-separated argument expressions enclosed in parentheses. The following expressions are all legal function calls: f(a, b), g(), (foo(3))(a, b, c, d), (proc(n) n * 4)(2). Functions may be declared with a variable number of arguments, but in all cases, it is an error to call a function with fewer or more arguments than is permitted by the function’s declaration.
This does not include built-in procedure functionality.