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

Re: Argument Lists

    Date: Sun, 22 Jun 86 02:52 EDT
    From: Kent M Pitman <KMP@SCRC-STONY-BROOK.ARPA>
    To: Fahlman@C.CS.CMU.EDU
    Subject: Argument Lists
    Message-ID: <860622025257.9.KMP@RIO-DE-JANEIRO.SCRC.Symbolics.COM>
    Personally, I think something that computes minimum/maximum number of
    arguments should be put into the language. I'll defer any recommendation about
    something which gets the ARGLIST itself until I've thought harder about the
    If ARGLIST is put in, it should probably be under the name ARGUMENT-LIST.
One tool that would greatly benefit from information about the
lambda-list (the correct Lisp name for a parameter list or [sic]
argument list) is a portable "advise" tool (ala InterLisp and
ZetaLisp).  Without information as to the number of required,
optional, and (in some implementations?) keyword arguments (and in the
case of keyword arguments, the names of the keywords), the
encapsulation  function will be forced to do unnecessary consing
(because it will have to use &rest) and use a less efficient form of
function calling (in most impl.), APPLY.

The minimum acceptable functionality for a function providing
lambda-list info (I'll call it LAMBDA-LIST) would be the for it to
return the number of required args, the number of requireds+optionals
(or just the number of optional, if you prefer), and a flag indicating
whether or not a &rest/&key is present.

I would prefer that the function return the number of required args,
the number of optional args, a list of keyword names, a flag
indicating whether an &rest parameter exists, and a flag indicating
whether or not an &allow-other-keys exists.  But I realize that the
keyword info. may be a bit of a burden on some implementations.

The truly right way to do it is, as Mike Beckerle suggested, return the
type spec (but I wouldn't include the parameter names).  But I doubt
that implementors want to invest that much effort in it.

	-- Nick