[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:
http://groups.google.com/d/msg/comp.lang.lisp/W_YphmkN_4E/5POxWqpyd7wJ
- Re: Sweeter Emacs Lisp, (continued)
Re: Sweeter Emacs Lisp, Miles Bader, 2013/07/15
Re: Sweeter Emacs Lisp, Josh, 2013/07/14
Re: Sweeter Emacs Lisp, Stefan Monnier, 2013/07/15
Re: Sweeter Emacs Lisp, Stefan Monnier, 2013/07/16
Re: Sweeter Emacs Lisp, Andreas Schwab, 2013/07/14
Re: Sweeter Emacs Lisp, Miles Bader, 2013/07/15