[Top][All Lists]

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

Re: Sweeter Emacs Lisp

From: Lars Brinkhoff
Subject: Re: Sweeter Emacs Lisp
Date: Mon, 15 Jul 2013 08:05:50 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Juanma Barranquero <address@hidden> writes:
> Certainly. aif/awhen/when-let/if-let is so useful that it surely has
> been reimplemented a billion times. I have this in my .emacs
> (cl-defmacro whereas ((var test) &rest body)
>   "If TEST is non-nil, bind VAR to it and then run BODY.
> Return the value returned by the last form in BODY.
> Else, return nil.
> \n(fn (VAR TEST) &rest BODY)"
>   (declare (indent 1) (debug ((sexp form) body)))
>   `(let ((,var ,test))
>      (when ,var ,@body)))
> (I don't know where the "whereas" name originated, but I know I copied
> it from somewhere.)

Probably from Erik Naggum:


reply via email to

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