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

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

Re: newbie questions: why doesn't ((lambda (x) (x 2)) (lambda (n) (+ n 3


From: Johan Bockgård
Subject: Re: newbie questions: why doesn't ((lambda (x) (x 2)) (lambda (n) (+ n 3))) work in elisp?
Date: Sat, 31 May 2008 10:58:13 +0200
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.60 (gnu/linux)

Thien-Thi Nguyen <ttn@gnuvola.org> writes:

> ⎛⎞ Tahsin Alam <tahsin.alam@db.com>
> ⎝⎠ Fri, 30 May 2008 13:03:49 -0400
>
>    As the subject says - why does the following expression give
>    error when I try to evaluate it in the *scratch* buffer?
>
>    ((lambda (x) (x 2)) (lambda (n) (+ n 3)))
>
> One reason is because Emacs Lisp is not Scheme (sigh).
> You can try this, instead:
>
> (funcall (lambda (x) (funcall x 2)) (lambda (n) (+ n 3)))

The first funcall is unnecessary.

-- 
Johan Bockgård


reply via email to

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