[alexandria-devel] multiple values in switch clauses

Marco Baringer mb at bese.it
Thu Nov 22 08:02:02 UTC 2012


hi,

  i'd like switch to, just like case and typecase do, allow multiple
  values in the 'value' position of the condition:

  (switch (foo)
    ((bar baz) ...))

  So the attached patch checks for the key form being a cons and, if so,
  expands into a (member value :test test) instead of (test value)
  form. Of course, this means that your key values can no longer be
  forms, so this may break existing code. I don't have any code which
  actually uses a function call in the value form of the clause (and a
  quick grep over my locally installed lisp libs shows nobody else does
  either), so i'm ok with the change, but i can understand if others
  don't agree.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Support-multiple-keys-in-switch-clauses-similar-to-h.patch
Type: text/x-patch
Size: 3156 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/alexandria-devel/attachments/20121122/24abfc38/attachment.bin>
-------------- next part --------------


--
-marco


More information about the alexandria-devel mailing list