|
Subject: Re: Scheme help... From: Paul Prescod <papresco@xxxxxxxxxxxxxxxx> Date: Tue, 24 Feb 1998 15:27:11 -0500 (EST) |
I can tell you miss Perl from the amount of line-noise you add to your DSSSL
scripts. :)
Anyhow, the question is about the difference between this:
(define foo (bar))
and
(define (foo) (bar))
I don't have my Perl book with me, but they are roughly analogous to:
foo = bar()
and
foo = function (){ # no args
return bar();
}
Okay, that's not really Perl at all. The important thing to note is that
this syntax:
(define (foo) (bar)) is just a syntactic shortcut for
(define foo (lambda () (bar)))
Where lambda is the special form that creates a new procedure in Scheme.
The effect on current-node may be clear already. The non-lambda definition
tries to execute (bar) immediately, at definition time, and the lambda-based
definition tries to execute (bar) later, at the point where (foo) is actually
executed.
Paul Prescod
DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: Scheme help..., Daniel Speck | Thread | Re: Scheme help..., Earl Hood |
| Re: Scheme help..., Harald Hanche-Olsen | Date | Re: Scheme help..., Earl Hood |
| Month |