[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Argument Lists



In response to your request for a portable Common Lisp facility to
access any function's argument list and also its minimum and maximum arg
counts:

I think that the overwhelming majority of implementations provide some
sort of function for accessing the argument list.  The names that the
user gave to the arguments can be a very useful form of automatic
documentation, so this info is just too valuable not to make available
in some form at runtime.  I'm sure that if we took a poll, however, we
would find many different formats in use for reporting this information.
For example, do we return the original arglist, with all of the
default-argument forms in place, or just the variable names and which
ones are optional, rest, etc.

I think that it would be valuable to agree on the format for reporting
the arglist and include it in the language as a standard or
semi-standard facility so that we can all use it in the same way on
various machines and so that code can make use of this.  (Various help
systems would make good use of this info.)  We might want to make this a
"semi-standard" feature, meaning that it is optional, but do it this way
if you do it at all, since very small implementations might not want to
pay the price to keep this info around at runtime.  Then again, we added
docuemntation strings as a required facility and nobody complained --
these are kept outside the Lisp in a separate file in some
implementations, and the arglist info could be kept there as well.

Every implementation has some way of determining at runtime the minimum
and maximum argument counts for a function, so functions to report these
could be added at very little cost.  These, too, would be useful, though
you could derive this from the arglist info if you had to.

-- Scott