This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Questions about #!key arguments


On 10/25/2011 01:14 PM, Taylor Venable wrote:
I haven't been using Kawa for very long, so I don't know much about its
internals, but I humbly submit that there might be another option to
implement #!rest like Gambit does. If #!rest appears before #!key then
it contains the keywords; if #!rest appears after #!key then it does not.

That's a neat idea, but there is at least one problem: What if there are no keyword parameters, but there is a #!rest? In that case Gambit allows keyword actual arguments, putting them in the #!rest parameter. That is sometimes what you want (when you want to allow general keyword parameters), but usually you don't want keywords, and you want to treat keyword arguments as an error.

You could write #!key #!rest - i.e. an empty list of keyword
formats, but that seems clumsy and confusing.

I think we want two separate things:
- Bind a variable to the remaining keyword-value pairs.
- Bind a variable to the remaining non-keyword arguments.

Not sure what the answer is, but I do know we want to be stricter
than Kawa is, so the *compiler* can emit an error about bad keyword use.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]