Nic Ferrier
Nic Ferrier
So pretty much do the matching elsewhere? I really like dash's end of list mechanism by the way: `(a b . c)` as opposed to shadchen's `(a b (tail c))`...
Ah, right. Gotcha. But it would be nice if those things were all there. plist and alist matching out of the box would be fantastic. Ah well, perhaps I'll have...
Awww. Shucks. I just wish I understood your code. I can't possibly hope to keep up with you.
I don't think you need to clear it up. If I could give you any advice it would be "if it works, ship it". I am torn between this and...
So: ``` (defun extract/c (key) (lambda (plist) (plist-get key plist))) (defpattern plist (&rest kv-pairs) `(and ,@(loop for (k v . rest) on kv-pairs collect `(funcall (extract/c ,k) ,v)))) (match '(:one...
Aha. The definition of extract/c was wrong: ``` (defun extract/c (key) (lambda (plist) (plist-get plist key))) (defpattern plist (&rest kv-pairs) `(and ,@(loop for (k v . rest) on kv-pairs collect...
... and alists too: ``` (defun extract/a (key) (lambda (alist) (cdr-safe (assoc key alist)))) (defpattern alist (&rest kv-pairs) (cl-labels ((alist-get (key) (lambda (alist) (cdr (assoc key alist))))) `(and ,@(loop for...
Great! I'll send a pr on that. Personally for testing I use ert which is built in, it works pretty well, I see no reason to use anything else. I...
I'll take a look at this myself I guess... but to what extent could `match` be a macro? then one could debug the evaluated forms.
You were asking about tests. A complex set of tests is here: https://github.com/joddie/macrostep/blob/master/macrostep-test.el