Re: Simple symbols as keywords soo (10 May 2006 04:02 UTC)
Re: Simple symbols as keywords Per Bothner (10 May 2006 05:15 UTC)

Re: Simple symbols as keywords Per Bothner 10 May 2006 05:15 UTC

soo wrote:
> For named parameters to be visually different from other parameters,
> I think
> (buy 'apple 'day 'low '(price 71.89) '(qty 1000))

Only works for constant parameters.  Otherwise, you'd have to
write:
   (buy 'apple 'day 'low `(price ,my-price) `(qty ,my-qty))
which I think is rather ugly

> or
> (buy 'apple 'day 'low ##price## 71.89 ##qty## 1000)
> would be better.

I earlier suggested:
   (buy 'apple 'day 'low price=>my-price qty=>1000)
I.e.
   NAME=>EXPRESSION

It's compact, relatively "obvious" what it means, and visually
tries the name and the value together.

The syntax is orthogonal to the question of whether keywords
are a separate data type, or whether instead we use some kind
of "association" data type.
--
	--Per Bothner
xxxxxx@bothner.com   http://per.bothner.com/