bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#28254: 26.0.50; SRFI-2 and-let*


From: Mark Oteiza
Subject: bug#28254: 26.0.50; SRFI-2 and-let*
Date: Fri, 1 Sep 2017 22:10:43 -0400
User-agent: Mutt/1.8.3 (2017-05-23)

On 31/08/17 at 10:55pm, npostavs@users.sourceforge.net wrote:
Mark Oteiza <mvoteiza@udel.edu> writes:

its behavior overlaps with when-let* but each has things the other
lacks.

Can the differences be minimized?  I think having a bunch of tiny
differences is not good for reader comprehension or code reuse.

Understood.  I was leaning toward putting and-let* in its own file
because of the differences instead of having them all in the same
place.  I'd rather have no and-let* than a gimped and-let* (I shouldn't
have made the alias, in retrospect).

How much would be lost if we implemented and-let* like this?

(defmacro and-let* (varlist &rest body)
 `(when-let* ,varlist
    ,@(or body '(t))))

The (EXPR) part of it, e.g.

 (and-let* ((x ...)
            (y ...)
            ((x > y)))
   ...)

where the body gets executed if x > y.

I didn't try writing it in the style of if-let*--perhaps if-let* could
be extended and all three macros would learn (EXPR).  if-let* already
has the single tuple quirk which differs from most (if not all?) lets in
Elisp.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]