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

case using other equality-testing predicates

    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