all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: bojohan+news@dd.chalmers.se (Johan Bockgård)
To: help-gnu-emacs@gnu.org
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	[thread overview]
Message-ID: <yoijej7isvdm.fsf@remote5.student.chalmers.se> (raw)
In-Reply-To: mailman.12481.1212216300.18990.help-gnu-emacs@gnu.org

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


  parent reply	other threads:[~2008-05-31  8:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-30 17:03 newbie questions: why doesn't ((lambda (x) (x 2)) (lambda (n) (+ n 3))) work in elisp? Tahsin Alam
2008-05-31  6:41 ` Thien-Thi Nguyen
     [not found] ` <mailman.12481.1212216300.18990.help-gnu-emacs@gnu.org>
2008-05-31  8:58   ` Johan Bockgård [this message]
     [not found] <mailman.12463.1212181801.18990.help-gnu-emacs@gnu.org>
2008-05-30 21:27 ` Joost Diepenmaat
2008-05-30 21:33   ` Joost Diepenmaat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yoijej7isvdm.fsf@remote5.student.chalmers.se \
    --to=bojohan+news@dd.chalmers.se \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.