Subject: Re: what si the gain with lambda here?
From: (Rob Warnock)
Date: Sun, 11 May 2008 22:55:13 -0500
Newsgroups: comp.lang.scheme
Message-ID: <>
globalrev  <> wrote:
| (define add2 (lambda (x) (+ x 2)))
| as opposed to (define (add2 x)  (+ x 2))
| what is the difference?

None at all, at the top level of the REPL -- in that
case the latter is simply syntactic sugar for the former.
Note however that inside certain binding contours
[what is called a "<body>" in the EBNF] the latter
expands into a LETREC, not a top-level assignment.
See the following for the distinction between the two:
    5.2    Definitions
    5.2.1  Top level definitions
    5.2.2  Internal definitions

[And next time, try RTFM before asking such a question...]


Rob Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607