From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bolega Newsgroups: gmane.emacs.help Subject: Re: lambda inside a let or letrec Date: Wed, 9 Jun 2010 23:18:25 -0700 (PDT) Organization: http://groups.google.com Message-ID: <571723a4-e5b3-403a-b856-fb377ee68c73@c10g2000yqi.googlegroups.com> References: <6b121cee-8a28-4e27-a733-40d22028e05d@i28g2000yqa.googlegroups.com> <3f3fa71f-f6a5-43e7-9736-c4bfc013141c@e5g2000yqn.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1291830414 4679 80.91.229.12 (8 Dec 2010 17:46:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Dec 2010 17:46:54 +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:50 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 1PQO6J-000492-GQ for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 18:46:47 +0100 Original-Received: from localhost ([127.0.0.1]:58167 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQO6I-00044a-R5 for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 12:46:46 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!c10g2000yqi.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.lang.lisp,comp.lang.scheme Original-Lines: 55 Original-NNTP-Posting-Host: 75.28.154.75 Original-X-Trace: posting.google.com 1276150705 32081 127.0.0.1 (10 Jun 2010 06:18:25 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 10 Jun 2010 06:18:25 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c10g2000yqi.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:178791 comp.lang.lisp:288889 comp.lang.scheme:86931 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:75726 Archived-At: On Jun 9, 10:37=A0pm, bolega wrote: > let me write it more clearly with indents as follows : > > (let > ((a (lambda (n) (+ 1 n))) > =A0(b 3)) > (a b)) > > On Jun 9, 10:34=A0pm, bolega wrote: > > > 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. > > > ( =A0 (lambda (n) (+ 1 n)) 3) =A0;;; works in emacs > > > (let > > ((a (lambda (n) (+ 1 n))) (b 3)) (a b)) =A0 ;;; 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 The following works where I have replaced the association of lambda to a _by_ the association of lambda function call to a, ie a numerical value. (let ((a ((lambda (n) (+ 1 n)) 5)) (b 3)) (+ a b)) I am sure I am making some trivial mistake