[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Oops!



Of course, my claim that evaluation order couldn't affect termination is bogus.
The following program illustrates one way using call/cc:

	(call/cc
	   (lamdba (k)
	      (f (k 0) (run-forever))))

If the arguments to f are evaluated left-to-right, it terminates returning 0;
otherwise, it diverges.

Of course, call/cc isn't necessary to show this.  Here's an example without it:

	(let ((f (lambda (x) 0)))
	   (f (set! f (lambda (x) (run-forever)))))

Now it depends upon whether f is evaluated before or after its argument.

Sorry for the bogus claim,

	Pavel