On 18 Mar 2008, at 13:46, Pascal Costanza wrote:
On 18 Mar 2008, at 12:52, Edi Weitz wrote:
On Tue, 18 Mar 2008 12:36:47 +0100, Pascal Costanza pc@p-cos.net wrote:
...but that's ambiguous:
Only if you insist on having a short form without parentheses. That's not a hard-and-fast requirement.
What about backwards compatibility?
Or to put it differently: Are we talking about an extension of cl:case, or a new case that's different from cl:case?
(case (thing :test #'=) (42 'foo) (4711 'bar))
What's the result of that form?
Error: The variable THING is unbound.
There was a binding for a function and a variable thing in my example.
cl:case would interpret the second form as a call of the function thing, and that should remain so for backwards compatibility.
BTW, even if we are talking about a new my-case, it may be a good idea to remain backwards compatible to ease 'refactoring' between cl:case and my-case. It would be an unnecessary source of bugs if you had to add or remove parentheses in the first argument when you want to go from one operator to the other. These are things that are easily forgotten, especially if something looks otherwise innocuous.
Pascal