[plt-scheme] Keyword args

From: Paul Schlie (schlie at comcast.net)
Date: Sat Oct 23 21:31:45 EDT 2004

Maybe support both as Kawa does:

(which defaults to the x: form likely for the reasons below, but
 supports the :x form for historical common-lisp fans, etc.)


> From: Paul Schlie <schlie at comcast.net>
> Date: Sat, 23 Oct 2004 21:21:29 -0400
> To: Eli Barzilay <eli at barzilay.org>, Doug Orleans <dougo at place.org>
> Cc: <plt-scheme at web-ext.cs.brown.edu>, <plt-scheme at list.cs.brown.edu>
> Subject: Re: [plt-scheme] Keyword args
> I understand.
> To me, 'x is clearly a shorthand for (quote x) as the quote ' both precedes
> it's argument in both cases, and is clearly logically associated with the
> symbol it's been pre-pended to.
> However although :x 2 may be though of as shorthand for (: x 2), it doesn't
> intuitively seem natural to presume it extends it's semantic influence beyond
> the symbol it's been pre-pended to, as x: 2 seems to more intuitively
> naturally indicate given it's traditional syntactic and semantic use. (which
> is I guess why I find (procedure :x 3 :y 3) visually disturbing, as I  tend to
> quickly parse as (( procedure :x) (3 :x) 3), which I know is not what was
> intended.
> Which may just be me,
> -paul-
>> From: Eli Barzilay <eli at barzilay.org>
>>> On Oct 22, Paul Schlie wrote:
>>> [...]
>>>  -but-please-not-
>>> (some-function :x 1 :y 2)
>> It is a very popular format for keywords, there is tons of code that
>> will break if it is changed.
>>> As for whatever reason, I still can't help finding it visually
>>> disturbing, and contradicting my instinctive expectations of a colon
>>> appearing between associated elements, prefixing the keyword just
>>> doesn't feel reasonable.
>> If you think about the ":" as a form of "'" (visually) then it does
>> make sense.
>> On Oct 22, Doug Orleans wrote:
>>> How do you feel about this:
>>> (some-function 'x 1 'y 2)
>> The problem with this is that what you really want is a new type, not
>> like other symbols.  (Or did you say this to make the same point I had
>> above.)
>> If mzscheme would have a simple reader syntax facility, I'd make
>> Swindle turn `:foo' into something different than the symbol `'foo'.
>> Actually, I think that it is hackable, maybe it's worth
>> implementing...  (Obviously, that will break some amount of code
>> too...)
>> -- 
>>           ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
>>                   http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.