Email list hosting service & mailing list manager


Re: Alternative formulations of keywords Per Bothner 12 Apr 2006 03:04 UTC

John Cowan wrote:
> Marc Feeley scripsit:
>> Are you saying that the programmer writes
>>
>>      (foo 'bar foo: 32 bar: 54)
>>
>> and the compiler transforms this to
>>
>>      (foo 'bar (list (cons 'foo: 32) (cons 'bar: 54)))
>
> No, to a literal, not a run-time constructor.

What if you replace 32 and 54 by non-literal expressions?

>> ... A general implementation
>> of SRFI 89 must parse the list of parameters at run time because some
>> of the keywords may be computed.
>
> What are the use cases for computed keywords?

As long as one can handle computed keywords using (apply ...) or some
similar higher-order function, then I really don't care about computed
keyword support in the "sugared syntax".

Note also that if we define [as I suggested in my previous message]
   keyword: value  ;; or whatever alternative syntax is chosen
as syntactic sugar for:
   (make-association 'keyword value)
then handling computed keywords is easy by writing an explicit
make-association call.
--
	--Per Bothner
xxxxxx@bothner.com   http://per.bothner.com/