[Top][All Lists]

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

Re: Anaphoric macros: increase visibility

From: Michael Heerdegen
Subject: Re: Anaphoric macros: increase visibility
Date: Sun, 15 Jan 2017 01:39:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.91 (gnu/linux)

Hi Tino,

> I wonder if it has sense to increase that family with a while-let
> (maybe others in case they are useful).
> From 60f26b512b191add12a0c91dc4d7ff95aba080d9 Mon Sep 17 00:00:00 2001
> From: Tino Calancha <address@hidden>
> Date: Sat, 14 Jan 2017 14:25:42 +0900
> Subject: [PATCH] * lisp/emacs-lisp/subr-x.el (while-let): New macro.

Maybe.  I'm using `when-let' and `if-let' a lot, but I'm still not sure
in which direction we should develop this approach.  I personally prefer
`when-let' and `if-let' over `awhen' and `aif'.  I sometimes think that
`if-let*' would be a better name for `if-let' because bindings can refer
(and naturally most of the time do) refer to other bindings.  I also
often think that `and-let' (or `and-let*' ...)  would be a better name
for `when-let' (because the expressions for the bindings are `and'ed,
sot the whole thing feels more like `and' to me).  And I often think
that it would be cool to couple them with pcase pattern matching.  OTOH
we already have `pcase-let', but I can't get along with its semantics,

(pcase-let ((`(,a ,b) '(1 2 3)))
  (list a b))

==> (1 2)

although the pattern doesn't match.

Anyway, I think we should have an imagination of where the travel should
end before adding more *-let macros.



reply via email to

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