emacs-devel
[Top][All Lists]
Advanced

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

Re: Sweeter Emacs Lisp


From: Stefan Monnier
Subject: Re: Sweeter Emacs Lisp
Date: Mon, 22 Jul 2013 17:04:04 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>    So maybe a when-let makes sense, tho I'd prefer a when-let*
>    (which has also been seen under the name let-and, IIRC).
> Are you willing to consider Scheme's ‘and-let*’ (SRFI 2).

Sounds like the same thing, yes.

> IIRC i also proposed, maybe a year back, a Schemish ‘cond’
> (with ‘=>’) but it was rejected.  RMS suggested instead:
>  (cond VAR (CONDITION [BODY...])
>            ...)

As I pointed out back then, a more general solution is a way to let-bind
new variables in between cond clauses, as in

   (cond
    (<test1> <body1>)
    (let x <foo>)
    (<test2> <body2>))

which would be used in cases where we currently use
    
   (let (x)
     (cond
      (<test1> <body1>)
      ((progn (setq x <foo>) <test2>) <body2>))


-- Stefan



reply via email to

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