emacs-devel
[Top][All Lists]
Advanced

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

Re: Anaphoric macros: increase visibility


From: Rolf Ade
Subject: Re: Anaphoric macros: increase visibility
Date: Sat, 14 Jan 2017 03:30:19 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Michael Heerdegen <address@hidden> writes:
> We also already have `if-let' and `when-let' in "subr-x".  They are like
> `aif' and `awhen' but you specify "it" explicitly.

Since you mention them ... I probably miss something obvious but from
looking at the documentation of if-let

    if-let is a Lisp macro in ‘subr-x.el’.

    (if-let BINDINGS THEN &rest ELSE)

    Process BINDINGS and if all values are non-nil eval THEN, else ELSE.
    Argument BINDINGS is a list of tuples whose car is a symbol to be
    bound and (optionally) used in THEN, and its cadr is a sexp to be
    evalled to set symbol’s value.  In the special case you only want
    to bind a single value, BINDINGS can just be a plain tuple.

and of if-when

    when-let is a Lisp macro in ‘subr-x.el’.

    (when-let BINDINGS &rest BODY)

    Process BINDINGS and if all values are non-nil eval BODY.
    Argument BINDINGS is a list of tuples whose car is a symbol to be
    bound and (optionally) used in BODY, and its cadr is a sexp to be
    evalled to set symbol’s value.  In the special case you only want
    to bind a single value, BINDINGS can just be a plain tuple.

I don't get, why there is a need for if-when?




reply via email to

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