LISP and Symbolic Computation, 3(3)229-244
A New Approach to Procedures with Variable Arity
R. Kent Dybvig, Indiana University Computer Science Department, Bloomington, IN 47405
Robert Hieb, Indiana University Computer Science Department, Bloomington, IN 47405
Abstract: This article presents a convenient and efficient
procedural interface that allows the definition and use of procedures
with optional arguments and indefinite numbers of arguments without
resorting to the use of a language-dependent data structure in which
to store the arguments. This interface solves many of the problems
inherent in the use of lists in Lisp and Scheme to store indefinite
numbers of arguments. Simple recursion can be used to consume such
arguments without the complexity problems that are caused by the use
of the Lisp procedure apply on argument lists. A natural extension to
the interface to support multiple return values is presented.
Keywords: Lisp, Scheme, procedure call, optional arguments,
multiple return values
|
[local copy]
|
|