[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
case using other equality-testing predicates
- To: "David A. Moon" <Moon@SCRC-STONY-BROOK.ARPA>
- Subject: case using other equality-testing predicates
- From: "Scott E. Fahlman" <Fahlman@C.CS.CMU.EDU>
- Date: Wed, 21 May 1986 03:45:00 -0000
- Cc: common-lisp@SU-AI.ARPA
- In-reply-to: Msg of 20 May 1986 15:35-EDT from David A. Moon <Moon at SCRC-STONY-BROOK.ARPA>
- Sender: FAHLMAN@C.CS.CMU.EDU
I'm sure some people will jump all over me for suggesting this,
but it might be better to allow CASE to accept a :TEST keyword. Which
of these three syntaxes do you-all prefer?
(selector item equalp ("foo" ...) ...)
(case item :test #'equalp ("foo" ...) ...)
(cond ((equalp item "foo") ...) ...)
I think that mixing keywords into a construct like Case that already has
a complex syntax is likely to cause confusion. I would prefer adding a
new construct CASE-TEST that would look like
(case-test #'equalp item ("foo" ...) ...)
This is similar to your Selector, but without the odd treatment of the
test function, and the name emphasizes the close parallel to Case. I
think it is best to put the test function before the item -- other
things in the language put the testing function first.
-- Scott