[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple symbols as keywords



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
per@bothner.com   http://per.bothner.com/