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

Re: Q: spec on #rest and #key



#rest collects all of the values past the mandatory arguments
into a sequence.

#key says that, at this point in the arglist, there are pairs of
keywords and values.

#all-keys says that, in the keyword arguments, there may be
keyword value pairs whose name (the keyword) is not explicitly
specified by something in #key.

So you can have #rest and #key simultaneously, but you can't
really have a #rest arg that is completely unconstrained -- it
still needs to have key-val pairs.

Rob Myers wrote in message <200105171007.GAA00739@life.ai.mit.edu>...
>On Thursday, May 17, 2001, at 09:30  am, Roland Paterson-Jones wrote:
>
>> Forgive my ignorance, but can't you detect the difference between
>> key/value
>> pairs and other arguments, simply because a key/value is a pair of
>> arguments
>> between ','s and the other arguments are a single syntactic element
>> between
>> ','s. Can you illustrate an ambiguous case for me with an example?
>
>I think #keys get flattened into two parameters, the symbol and the
>value.
>
>> Would it be possible to introduce an explicit syntactic element to
>> partition
>> the arguments into mandatory+rest and key arguments (where necessary)?
>> It
>> just seems to me that functions using #rest would benefit from #key
>> facility
>> just as much as functions without #rest.
>
>There's #all-keys. I forget how this interacts with #rest.