From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bolega Newsgroups: gmane.emacs.help Subject: lambda inside a let or letrec Date: Wed, 9 Jun 2010 22:34:14 -0700 (PDT) Organization: http://groups.google.com Message-ID: <6b121cee-8a28-4e27-a733-40d22028e05d@i28g2000yqa.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1291830387 4563 80.91.229.12 (8 Dec 2010 17:46:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Dec 2010 17:46:27 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 08 18:46:24 2010 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.69) (envelope-from ) id 1PQO5u-0003sb-Qx for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 18:46:23 +0100 Original-Received: from localhost ([127.0.0.1]:57733 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQO5u-0003q9-8j for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 12:46:22 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!i28g2000yqa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.lang.lisp,comp.lang.scheme Original-Lines: 38 Original-NNTP-Posting-Host: 75.28.154.75 Original-X-Trace: posting.google.com 1276148073 12972 127.0.0.1 (10 Jun 2010 05:34:33 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 10 Jun 2010 05:34:33 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: i28g2000yqa.googlegroups.com; posting-host=75.28.154.75; posting-account=REkl4woAAABFXaU7nL79XtGpnmNCQ415 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:178788 comp.lang.lisp:288885 comp.lang.scheme:86928 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:75724 Archived-At: My apologies in advance to comp.lang.scheme and comp.lang.lisp. I am trying to run a certain syntax inside emacs lisp. I know basically how let works (let (list of pairs of var value) (function)) This is like a lambda function call , only the order is different. But the novelty i saw reading a book on common lisp or scheme is this and i failed to run in emacs. plz tell what modifications are needed and i know they are different. ( (lambda (n) (+ 1 n)) 3) ;;; works in emacs (let ((a (lambda (n) (+ 1 n))) (b 3)) (a b)) ;;; does NOT work in emacs basically we are trying to use / abuse the let in that in the pair we define a equal to a lambda. Then another pair where a value of b is defined. next, we want a to operate on b. Why does it fail ? The scheme/lisp book/paper where it was seen (forgot) used letrec. Can someone enlighten me how set! and let can be used to formulate recursion when the let has no recursion built in it ? thanks a lot. cheers