[Top][All Lists]

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

Re: if-let/if-let*/and-let/..

From: Eric Abrahamsen
Subject: Re: if-let/if-let*/and-let/..
Date: Tue, 13 Feb 2018 13:57:27 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Michael Heerdegen <address@hidden> writes:

> Mark Oteiza <address@hidden> writes:
>> If we are ok with breaking code that depends on the special case (SYMBOL
>> VALUEFORM) semantics that the original if-let and when-let had, that is:
>>   (when-let (a 1) a)
>> then we could just make them aliases--they are separate from the
>> {if,when}-let* simply to avoid breaking code.
> Ah, that was the reason.  I'm not sure whether breaking this would be
> less bad than what we have currently.
> BTW, these forms don't seem to be used inside Emacs, but two files in
> Gnu Elpa use them:
> #+begin_src emacs-lisp
> ;;; *** /home/micha/software/elpa/packages/ebdb/ebdb.el  (1 match)
> ;;;; Line 5461
> (cl-defmethod ebdb-record-search ((record ebdb-record)
>                                 (_type (subclass ebdb-field-notes))
>                                 (regexp string))
>   (if-let (notes (slot-value record 'notes))
>       (ebdb-field-search notes regexp)))

Are you sure about this? In both my github repo and in the installed
version of EBDB, I've gone back to a pokey old when-inside-a-let,
precisely because of all the funkiness surrounding these macros. IIRC, I
treated the above use of `if-let' as a bug when I noticed it. I thought
I got rid of it quite a while ago...?

reply via email to

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