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

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

bug#67669: 29.1; Drop text suggesting using `and' to replace `if'


From: Drew Adams
Subject: bug#67669: 29.1; Drop text suggesting using `and' to replace `if'
Date: Fri, 8 Dec 2023 15:37:01 +0000

> (let (baz)
>   (setq foo (concat "bar" (if (stringp baz) baz))))
>   => "bar"
> 
> Here 'if' returns nil, and we use the feature of
> 'concat' to ignore nil arguments.

IMO the meaning/behavior is clearer with `and':

 (let (baz)
   (setq foo (concat "bar" (and (stringp baz) baz))))

But again, such stylistic concerns are exactly that.





reply via email to

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