[plt-scheme] Keyword args

From: Joe Marshall (jrm at ccs.neu.edu)
Date: Mon Oct 25 12:39:43 EDT 2004

> Paul Schlie writes:
>  >  -but-please-not-
>  > 
>  > (some-function :x 1 :y 2)

Doug Orleans <dougo at place.org> writes:
> (some-function 'x 1 'y 2)

In my un-called-for opinion, 

  (some-function 'x 1 'y 2)

is probably the right idea.  The arguments are keyed symbolically, so
it seems natural to use symbols.  The colon prefix, as in

  (some-function :x 1 :y 2)

simply adds a different way to quote symbols.

In Common Lisp, where symbols have `properties' other than their
identity, and two symbols with the same name are not necessarily the
same (if they are in different packages), it was necessary to have a
distinguished way to talk about symbols for their purely symbolic
meaning.  Keywords and the keyword package solve the problem nicely.
Scheme doesn't require this kludge.

On the other hand, the colon prefix is easy for Emacs to recognize and
highlight, and since I use both Lisp and Scheme I find it easier to
use the colon prefix for both, despite the arguments concerning
intellectual purity.

Posted on the users mailing list.