unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* ** Graded examples of lambda functions in emacs lisp, how to create hook variable? **
@ 2002-10-07 15:38 gnuist
  2002-10-07 15:54 ` David Kastrup
  2002-10-07 17:48 ` Kevin Rodgers
  0 siblings, 2 replies; 8+ messages in thread
From: gnuist @ 2002-10-07 15:38 UTC (permalink / raw)


lambda is often used to associate a hook with
the anonymous function. I do not see what advantage this gives over defun
other than saving a name in the name-space. Is there any other advantage
of lambda? Or is defun defined using lambda and name associating function?
The Lisp papers talk of "LABEL" function. But where is it in emacs or what
is its emacs counterpart called?

Here is a lambda function that I know for starters.

( (lambda(x y) (- x y))  1 2)

C-x C-e gives -1 in the minibuffer.

I can write more complicated defuns, single recursion, gcd, and all classic
stuff. But I am looking for a particularly instructive and clear example
of a double recursion and then probably a tricky one.

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"?

One last question at this stage: I know how you "add-hook" but how do you
create a hook variable in the first place? Is it something particular to
emacs?

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-10-08 17:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-07 15:38 ** Graded examples of lambda functions in emacs lisp, how to create hook variable? ** gnuist
2002-10-07 15:54 ` David Kastrup
2002-10-08 14:21   ` gnuist006
2002-10-08 15:13     ` David Kastrup
2002-10-07 17:48 ` Kevin Rodgers
2002-10-08 14:28   ` gnuist006
2002-10-08 16:16     ` Mark A. Flacy
2002-10-08 17:19     ` Kevin Rodgers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).