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

Issue: UNWIND-PROTECT-CLEANUP-NON-LOCAL-EXIT (Version 4)



    Date: Wed, 1 Jun 88 13:14 EDT
    From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>

    ...
    Here's the issue: can a portable program assume that the lifetime of a
    block or catch ends at the last possible moment, when control reaches
    the caller of the block or catch?  Or must portable programs assume that
    this lifetime ends at the first possible moment, when THROW has decided
    not to signal the error mentioned in the last sentence (outside of
    notes) on CLtL p.142?  I maintain that the semantics should be defined
    in the way which is most restrictive on portable programs and least
    restrictive on implementations, that is, portable programs must assume
    that the lifetime ends at the first possible moment that CLtL allows it
    to end.
    ...

My "naive model" has always been that an unwind-protect happens "as" (not
"after") an unwind occurs. I believe that this model is consistent only with
the idea that the dynamic state is retained until the last possible moment,
not the first. A major driving force in my reasoning is the fact that special
variable bindings have been partly unwound at the time the cleanup form is
run -- I find it more consistent to have all dynamic state unwinding at the
same time than to have the hairy N-pass unwinding strategy which seems to result
 from the model you're suggesting. I hope that your proposal will address this
issue.