[plt-scheme] Re: to define, or to let (last try)

From: Joe Marshall (jrm at ccs.neu.edu)
Date: Tue Apr 27 15:43:58 EDT 2004

Paul Schlie <schlie at comcast.net> writes:

> In a nutshell if evaluation order were defined, all presently unambiguous
> programs would remain unambiguous, and equivalent to their ordered
> evaluation counterparts; 

Yes.  Since this is equivalent on both it does not matter.

> and all presently ambiguous programs would become unambiguous; net
> win-win, loosing nothing with any demonstrable value,
> unless some one somehow perceives that being able to specify a presently
> ambiguous program has value, which no one has been able to demonstrate)

It looses a small amount of value through overspecification and
complication of the language.  It gains nothing.

> What value is derivable from being able to "assert" I believe that the
> arguments to let or functions are evaluation order insensitive?
> (answer: none, as if they are, its equivalent to their sequential
> evaluation, otherwise un-diagnosably ambiguous, thereby only needlessly
> preventing the programmer from being able to utilize arbitrary monadic
> (or similar) functions as arguments to functions, let, etc. resulting
> in their unnecessary restricted reliable use)

This is incorrect.  When I see a fragment of code written thus:

 (foo (compute-a) (compute-b))

Then I know that it is equivalent to this:

  (let ((arg2 (compute-b)))
    (foo (compute-a) arg2))

or vice versa.

However were it written like this:

(let* ((arg1 (compute-a))
       (arg2 (compute-b)))
  (foo arg1 arg2))

I *know* that this:

(let* ((arg2 (compute-b)))
  (foo (compute-a) arg2))

is a different program.

Posted on the users mailing list.