[Top][All Lists]

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

Re: emacs lisp syntax rfc: (cond (EXPR => (lambda (X) ...)))

From: Stefan Monnier
Subject: Re: emacs lisp syntax rfc: (cond (EXPR => (lambda (X) ...)))
Date: Sun, 02 Jan 2011 21:19:44 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> In Scheme, the expression:
>   (cond (EXPR => (lambda (X) ...)))

> provides the lambda expression parameter X with the non-false
> value computed from evaluating EXPR.  However, if EXPR evaluates
> to false, control falls through to the next ‘cond’ clause, as
> usual.  The syntax requires the symbol ‘=>’ between EXPR and the
> lambda expression, without which the non-false value is discarded
> (i.e., the status quo).

> What do people think of adding this to Emacs Lisp?  (I would be
> grateful for pointers to any previous discussion on the matter.)

Doesn't sound bad: it's a conservative extension which doesn't seem to
introduce any significant incompatibility.  The only problem I can see
with it is that it relies on a function call, which is a slow operation
in the current Elisp implementation.


reply via email to

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