[Prev][Next][Index][Thread]
Re: Q: spec on #rest and #key
-
To: info-dylan@ai.mit.edu
-
Subject: Re: Q: spec on #rest and #key
-
From: "Scott McKay" <swm@mediaone.net>
-
Date: Thu, 17 May 2001 09:00:02 -0400 (EDT)
-
Organization: Road Runner
-
References: <200105171007.GAA00739@life.ai.mit.edu>
-
Xref: traf.lcs.mit.edu comp.lang.dylan:13306
#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.