emacs-devel
[Top][All Lists]
Advanced

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

Re: Anaphoric macros: increase visibility


From: Dmitri Paduchikh
Subject: Re: Anaphoric macros: increase visibility
Date: Sat, 14 Jan 2017 11:25:15 +0500
User-agent: Gnus/5.13 (Gnus v5.13)

Michael Heerdegen <address@hidden> wrote:

> Tino Calancha <address@hidden> writes:

>> Hi,
>>
>> I think anaphoric macros are a nice idiom; occasionally
>> they allow to write very concise and clear expressions.
>>
>> AFAICS, in the Emacs tree they are just introduced in ibuf-macs.el
>> (`ibuffer-aif', `ibuffer-awhen').

> We also already have `if-let' and `when-let' in "subr-x".  They are like
> `aif' and `awhen' but you specify "it" explicitly.

This explicitness argument seems to be standard criticism against anaphoric
macros. But it's easy to fix by providing new names for these macros: if-it,
when-it, and so on. Besides being more explicit these names are more readable
than aif and awhen. Comparing if-it, when-it with if-let, when-let, it seems
clear that they represent different tradeoffs of simplicity vs. flexibility.

With best regards
Dmitri Paduchikh



reply via email to

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