|
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 |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: DSSSL side effect-freeness, Harald Hanche-Olsen | Thread | Re: DSSSL side effect-freeness, Paul Prescod |
| Re: converting SGML DTDs was Re: DD, Paul Prescod | Date | RE: DSSSL side effect-freeness, Frank A. Christoph |
| Month |