From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.help Subject: Re: newbie questions: why doesn't ((lambda (x) (x 2)) (lambda (n) (+ n 3))) work in elisp? Date: Sat, 31 May 2008 08:41:40 +0200 Message-ID: <87mym7asbf.fsf@ambire.localdomain> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1212216332 28356 80.91.229.12 (31 May 2008 06:45:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 31 May 2008 06:45:32 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Tahsin Alam Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat May 31 08:46:14 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K2Kqr-00030E-GG for geh-help-gnu-emacs@m.gmane.org; Sat, 31 May 2008 08:46:05 +0200 Original-Received: from localhost ([127.0.0.1]:39018 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K2Kq5-0003za-LY for geh-help-gnu-emacs@m.gmane.org; Sat, 31 May 2008 02:45:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K2Kpm-0003zP-Kf for help-gnu-emacs@gnu.org; Sat, 31 May 2008 02:44:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K2Kpj-0003zD-Rz for help-gnu-emacs@gnu.org; Sat, 31 May 2008 02:44:57 -0400 Original-Received: from [199.232.76.173] (port=49094 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K2Kpj-0003zA-Mz for help-gnu-emacs@gnu.org; Sat, 31 May 2008 02:44:55 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:34152) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K2Kpj-0001fP-Vl for help-gnu-emacs@gnu.org; Sat, 31 May 2008 02:44:56 -0400 Original-Received: from [151.61.140.207] (helo=ambire.localdomain) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K2Kph-0000xl-Rn for help-gnu-emacs@gnu.org; Sat, 31 May 2008 02:44:54 -0400 Original-Received: from ttn by ambire.localdomain with local (Exim 4.63) (envelope-from ) id 1K2Kma-0001YD-Rr; Sat, 31 May 2008 08:41:40 +0200 In-Reply-To: (Tahsin Alam's message of "Fri, 30 May 2008 13:03:49 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by mx20.gnu.org: Genre and OS details not recognized. X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:54381 Archived-At: =E2=8E=9B=E2=8E=9E Tahsin Alam =E2=8E=9D=E2=8E=A0 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))) thi