[alexandria-devel] switch
hi! i was touching SWITCH and friends to understand #'string= and 'string= and created a shared expander for the 3 variants. in the process i was thinking that removing the :default key arg and testing for a 'cl:otherwise clause would be much more cl-ish, but that would mean an incompatible change. (switch ("xxx" :test #'string=) ("alma" 1) ("korte" 2) (otherwise 42)) opposed to (switch ("xxx" :test #'string= :default 42) ("alma" 1) ("korte" 2)) what do people thing about it? -- attila
On 31/07/07, Attila Lendvai <attila.lendvai@gmail.com> wrote:
in the process i was thinking that removing the :default key arg and testing for a 'cl:otherwise clause would be much more cl-ish, but that would mean an incompatible change.
(switch ("xxx" :test #'string=) ("alma" 1) ("korte" 2) (otherwise 42))
Looks much better than the :default argument, IMHO. Could it also accept T as a synonym for OTHERWISE? -- Luís Oliveira http://student.dei.uc.pt/~lmoliv/
(switch ("xxx" :test #'string=) ("alma" 1) ("korte" 2) (otherwise 42))
Looks much better than the :default argument, IMHO. Could it also accept T as a synonym for OTHERWISE?
hm, i was thinking why :default was born and i thought that because specially handling T is somehow confusing or makes some situations impossible to handle. but after giving a few more thoughts i think T could also be used just like with COND and CASE. -- attila
On 7/31/07, Attila Lendvai <attila.lendvai@gmail.com> wrote:
(switch ("xxx" :test #'string=) ("alma" 1) ("korte" 2) (otherwise 42))
Looks much better than the :default argument, IMHO. Could it also accept T as a synonym for OTHERWISE?
hm, i was thinking why :default was born and i thought that because specially handling T is somehow confusing or makes some situations impossible to handle. but after giving a few more thoughts i think T could also be used just like with COND and CASE.
T and OTHERWISE are both fine with me, I think. Cheers, -- Nikodemus
participants (3)
-
Attila Lendvai
-
Luís Oliveira
-
Nikodemus Siivola