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

yellow pages



    The reason that Ken's ERROR (which corresponds to CERROR in MacScheme)
    can be a procedure rather than a special form is that programmers can
    avoid calling it in a tail-recursive position if think they might want
    to examine the environment of the procedure from which it is called.
    That is, they can write (BEGIN (ERROR ...) #T) instead of (ERROR ...)
    if they want.  I suspect that anyone who prefers a special form to this
    is probably going to be unhappy with Scheme anyway.

I understand that.  That is why I suggested that the error special
form could expand into

((error-procedure <args>)) 

which again guarantees non tail-recursive position.

I disagree, however, with two of the points of the above paragraph:

    I suspect that anyone who prefers a special form to this
	is probably going to be unhappy with Scheme anyway.

I disagree with this sentence for obvious reasons.

							    programmers can
	avoid calling it in a tail-recursive position if think they might want
	to examine the environment of the procedure from which it is called.

The problem is that this choice by the programmer does not leave a
choice to the user of the program (who might be the same person at a
different point in time).  I've often been upset at an earlier version
of myself for flushing state in a program when thinking that I
obviously would never need to examine it.  

I think that having an ERROR procedure which makes it convenient to
flush the computation's state at a point when it should not be flushed
(as far as I'm concerned) is a really bad idea.  I'd much rather have
programmers go out of the way to flush the state at an error than the
other way around, as you suggest.