[plt-scheme] keywords (a possible alternative?)

From: Paul Schlie (schlie at comcast.net)
Date: Sun Oct 2 01:34:19 EDT 2005

> From: Eli Barzilay <eli at barzilay.org>
>> On Oct  1, Paul Schlie wrote:
>> Personally I dislike colon prefix keywords, as to me colons tend to imply
>> an association between elements, therefore a postfix positioning seems most
>> visually natural (but of course subject to the same incompatibilities).
>> However, wonder if something along the line of:
>>  (function (: keyword expression) ...)
>> Might be both more syntactically consistent with the language; and
>> enable keywords to be bound to argument expression lists, which a
>> pre/post-fixed keyword association couldn't syntactically naturally
>> support.
> Either you do allow them to be first order values
>   (let ([x (: key expr)])
>     (foo x))
> which will be even more inefficient, or you don't, which would make
> them useful only as a compile-time mechanism.  (But like I said, this
> is an orthogonal issue, and you you don't need keyword values to play
> with the above.)

- although I may misunderstand, not sure that such a thing is useful?

- as it seems that at one extreme keywords may be thought of as simply a
distributed extension of a function's name, serving primarily to clarify an
arguments role within a function, but not affect the binding order of the
argument expressions themselves:

 (add: x to: y) :: (add:to: x y)

or at the other extreme directly affects a function's argument binding,
as such must first effectively reorder a function's/macro's arguments prior
to their traditional evaluation by any function utilizing keyword arguments

where if given: 

 (define (sub x y) (- x y))

then hypothetically:

 (sub (: y 2) (: x 3)) => (sub 3 2) => 1

where intermediate combinations would seem to exist and be possibly useful?

> On Oct  1, Paul Schlie wrote:
>> [...]
> -- 
>           ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
>                   http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.