Re: Scheme help...

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
  • Scheme help...
    • Norman Walsh - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id MAA11150Tue, 24 Feb 1998 12:38:36 -0500 (EST)
      • Chris Maden - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id NAA11905Tue, 24 Feb 1998 13:25:56 -0500 (EST)
        • Harald Hanche-Olsen - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id NAA12831Tue, 24 Feb 1998 13:55:43 -0500 (EST)
      • Daniel Speck - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id NAA12415Tue, 24 Feb 1998 13:40:36 -0500 (EST)
      • Paul Prescod - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id PAA14183Tue, 24 Feb 1998 15:30:40 -0500 (EST) <=
        • Earl Hood - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id QAA14800Tue, 24 Feb 1998 16:06:14 -0500 (EST)
          • Kendall G. Clark - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id RAA15832Tue, 24 Feb 1998 17:23:58 -0500 (EST)
          • Norman Walsh - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id RAA16128Tue, 24 Feb 1998 17:39:30 -0500 (EST)
          • Kendall G. Clark - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id SAA16701Tue, 24 Feb 1998 18:15:51 -0500 (EST)