Re: DSSSL side effect-freeness

Subject: Re: DSSSL side effect-freeness
From: Paul Prescod <papresco@xxxxxxxxxxxxxxxx>
Date: Tue, 27 Jan 1998 18:40:40 -0500
Harald Hanche-Olsen wrote:
> And without such
> primitives, I don't see that there is any difference, from the point
> of view of the programmer, between call-by-value and
> call-by-reference!  | [...] but as I said above, I'm not a language theorist
> 
> Neither am I.  Pretty soon now, some such is going to come out of the
> woods and shoot both our arguments to pieces.  Such is life.

I'm not a language theorist, but I think you've more or less hit the
nail on the head. Call by value and call by reference are identical in
the absence of mutability. I thought that maybe the question was meant
to be about lazy vs. eager processing (evaluation order). I thought this
because laziness and side-effect-freeness often go hand in hand.

The evaluation order does not matter *except* for the fact that some
programs that will not terminate when evaluated eagerly WILL when
evaluated lazily. In other words, my understanding is that if the
language spec were lazy, this would not loop forever:

(define (fact num)
   (let ((b (* (fact (- num 1)) num)))
      (if (= num 0)
	b
	1)))

Since the dsssl spec. is based upon Scheme, it is eager, and so this
will cause an infinite loop. "b" will be evaluated before it is needed.

 Paul Prescod
--
"You have the wrong number."
"Eh? Isn't that the Odeon?"
"No, this is the Great Theater of Life. Admission is free, but the 
taxation is mortal. You come when you can, and leave when you must. The 
show is continuous. Good-night." -- Robertson Davies, "The Cunning Man"



 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread
  • DSSSL side effect-freeness
    • Frank A. Christoph - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id AAA21877Tue, 27 Jan 1998 00:01:20 -0500 (EST)
      • G. Ken Holman - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id JAA00629Tue, 27 Jan 1998 09:44:17 -0500 (EST)
        • Harald Hanche-Olsen - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id QAA03547Tue, 27 Jan 1998 16:26:24 -0500 (EST)
          • Paul Prescod - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id TAA10715Tue, 27 Jan 1998 19:42:59 -0500 (EST) <=
      • Paul Prescod - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id TAA10659Tue, 27 Jan 1998 19:42:27 -0500 (EST)
      • <Possible follow-ups>
      • Frank A. Christoph - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id AAA12305Wed, 28 Jan 1998 00:06:25 -0500 (EST)
        • Pierre Mai - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id OAA22416Wed, 28 Jan 1998 14:15:53 -0500 (EST)
        • Paul Prescod - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id RAA24174Wed, 28 Jan 1998 17:19:24 -0500 (EST)