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

Re: block/tagbody and catch/throw

    Date: Tue, 15 Apr 1986  19:59 EST
    From: Rob MacLachlan <RAM@C.CS.CMU.EDU>

    I think that the two examples referred to create more confusion than
    they eliminate.  It is a feature of the language that GO or RETURN can
    change the dynamic environment.  It is obvious from the scope rules
    that the block or tag is not within the catch, therefore when control
    is transferred to the block or tag, the catch is no longer in the
    dynamic environment.  How the catch disappears is an implementation
    detail.  It does make some sense to say that these code fragments are
    legal, but discussion about the implementation is inappropriate in the
    main text; it only confuses people.

    I have a feeling that these features are much more surprising to
    implementors than to users.

My thoughts exactly.  It should be sufficient to say that the return-from
(or go) can appear anywhere within the lexical scope of the block (or
tagbody).  The current wording about "surprising consequences" is so vague
that non-wizardly readers can easily be mislead into thinking the behavior
is much more mysterious than that.  It should be made clear that the
business of breaking up catchers is something that the implementor, not the
user, needs to think about.