unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* lambda inside a let or letrec
@ 2010-06-10  5:34 bolega
  2010-06-10  5:37 ` bolega
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: bolega @ 2010-06-10  5:34 UTC (permalink / raw)
  To: help-gnu-emacs

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






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

end of thread, other threads:[~2010-06-11  0:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-10  5:34 lambda inside a let or letrec bolega
2010-06-10  5:37 ` bolega
2010-06-10  6:18   ` bolega
2010-06-10  5:37 ` bolega
2010-06-10  7:22 ` Helmut Eller
2010-06-10 14:28 ` Pascal J. Bourguignon
2010-06-11  0:42 ` bolega

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).