Adam Porter

Results 2644 comments of Adam Porter

> I think this is what the implementation already returns. No, what I mean is returning matching and non-matching lists separately. Upon further reflection, perhaps a cons of two lists,...

Here's another example where this would be useful: https://github.com/zk-phi/sky-color-clock/blob/master/sky-color-clock.el#L263: ```el (defun sky-color-clock--emoji-moonphase (time) (let* ((time-in-days (/ (float-time time) 60 60 24)) (phase (mod (- time-in-days sky-color-clock--newmoon) sky-color-clock--moonphase-cycle))) (cond ((

By the way, an anaphoric version: ```el (defmacro --cond-> (test &rest forms) (declare (indent defun)) `(cond ,@(cl-loop for (it result) in forms when (eq it t) do (setq test t)...

FYI, in a similar vein, but for more more complicated use cases, I recently published this: https://github.com/alphapapa/taxy.el

@basil-conto Not exactly; the examples I showed don't work on that PR's code. However, @oskarkv's comment may explain why. Maybe the macro I've shown here should be named differently so...

> Imagine the difficulty for someone reading Elisp code with all these many similar but subtly different "magic" macros. ;) Yes, that's probably why not many of them have been...

This is a pretty nice API. :) In a similar vein, but for more more complicated use cases, I recently published this: https://github.com/alphapapa/taxy.el

Haha, thanks. My experience writing macros is very limited. By the way, what made me think of it is this: https://github.com/alphapapa/mosey.el/blob/master/mosey.el#L150 Here I need to reverse the result if `backward`...

I guess you mean "anaphoric." ;) Yes, this would be a useful macro.