From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: gnuist006@hotmail.com (gnuist006) Newsgroups: gmane.emacs.help Subject: Re: ** Graded examples of lambda functions in emacs lisp, how to create hook variable? ** Date: 8 Oct 2002 07:21:26 -0700 Organization: http://groups.google.com/ Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: <9e8ebeb2.0210070738.1b12118d@posting.google.com> NNTP-Posting-Host: localhost.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1034087295 17106 127.0.0.1 (8 Oct 2002 14:28:15 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 8 Oct 2002 14:28:15 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17yvLJ-0004RV-00 for ; Tue, 08 Oct 2002 16:28:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17yvJJ-0001Xp-00; Tue, 08 Oct 2002 10:26:09 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 33 Original-NNTP-Posting-Host: 209.179.38.48 Original-X-Trace: posting.google.com 1034086886 2741 127.0.0.1 (8 Oct 2002 14:21:26 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: 8 Oct 2002 14:21:26 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:105834 comp.emacs:75130 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:2381 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2381 David Kastrup wrote in message news:... > gnuist007@hotmail.com (gnuist) writes: > > > In the same way, I ask for GRADED examples of use of lambda. I am sure many > > of you can just cut and paste from your collection. Examples to illustrate > > recursion, etc. And how will you do recursion with/without "LABEL"? > > ((lambda (f n) (funcall f f n)) > (lambda (f n) (if (zerop n) 1 (* n (funcall f f (1- n))))) > 5) I know that many people intended to be helpful. But, this is the type of code I was looking for the one that runs in emacs since that is the only interpreter I have running. However, I would want some explanatory comments. Is funcall a primitive function of emacs lisp in the sense of the 5 primitive functions of JM (macarthy's) lisp? Is it corresponding to the primitive "LABEL" that is discussed in his papers? On the other thread today you posted this one and it runs on emacs. Can you give some explanatory comments/dissection? ((lambda (f g n) (funcall g (funcall f f g) n)) (lambda (f g) `(lambda (n) (,g (funcall ,f ,f ,g) n))) (lambda (f n) (if (zerop n) 1 (* n (funcall f (1- n))))) 5) I think that of all the post this was helpful since it starts where my knowledge ends on this subject.