Hello all,
The `destructuring-case` macro imo is a little different than I would think it would be upon just hearing the name.
The thing is, i'd have made the clauses to basically the `destructuring-bind` form, except that a clause is executed if the 'nested lists-shape' matches, and all non-symbols, keywords match. I'd add `quote` as special, something that also must match exactly, and maybe `lambda`/`function` to indicate a function that must return true.(which now i think of it is an idea for the next section.)
(shameless plug)Maybe the reason is that i wrote a `destructuring-regex` https://github.com/o-jasper/j-basic/blob/master/src/destructuring-regex.lisp of which the idea is that the variables can simply be written on the matches/space between the matches.(Further each lisp object can add a method giving the regular expression for it, and also provide a parser) It uses the regex package though, is cl-ppcre more commonly used as dependency?
But basically, i have a `regex-case` for it. Them being regexes and either matching or not make it obvious how that should work!
Looking at the git log it was added Sep23 2010, so i am probably too late to change `destructuring-case`? I dont know, i see there are no official releases, and it might sneakily be that many people are using the link from the cliki page!(from 2008)
- Ending a hopefully not too inane post, Jasper
On 20 March 2012 22:34, Jasper o.jasper@gmail.com wrote:
The `destructuring-case` macro imo is a little different than I would think it would be upon just hearing the name.
The current form of it is AFAIK the "classic" interpretation -- and yeah, changing it now is a bit late.
Typical use case is a eg. parsing macro options:
(defmacro deffoo (&body options) (dolist (option options) (destructuring-case option (:foo ...) (:bar ...) (:quux ...))))
Cheers,
-- nikodemus
alexandria-devel@common-lisp.net