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

Re: Simple symbols as keywords

This page is part of the web mail archives of SRFI 89 from before July 7th, 2015. The new archives for SRFI 89 contain all messages, not just those from before July 7th, 2015.

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