[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Simple symbols as keywords
For named parameters to be visually different from other parameters,
(buy 'apple 'day 'low '(price 71.89) '(qty 1000))
Only works for constant parameters. Otherwise, you'd have to
(buy 'apple 'day 'low `(price ,my-price) `(qty ,my-qty))
which I think is rather ugly
(buy 'apple 'day 'low ##price## 71.89 ##qty## 1000)
would be better.
I earlier suggested:
(buy 'apple 'day 'low price=>my-price qty=>1000)
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.