[R6RS] safe and unsafe; declarations
dyb at cs.indiana.edu
dyb at cs.indiana.edu
Sun Mar 5 02:56:45 EST 2006
> Is it all right for an implementation to make the
> identifier-priority procedure return 0 in all cases,
> even if an implementation doesn't actually implement
> an unsafe mode?
If we're going to require implementations to be safe by default, then I
prefer for the reported safe priority to be nonzero, at least in the
absense of a declaration to the contrary. This allows user-defined code
that raises its own exceptions only when the safe priority is nonzero to
behave in a manner consistent with the safe default. I believe that
returning 0 for the other priorities is consistent with the current
safe/unsafe proposal.
> Is it all right for an implementation to make the
> identifier-priority procedure return 3 in all cases,
> even when macro-expanding within the scope of an
> unsafe declaration?
I would say yes, if declarations are ignored. In my opinion, however, the
reported priority should be accurate in the sense that the implementation
cannot itself treat an identifier in a manner that is inconsistent with
the priority it reports for that identifier. While it might be possible
to detect violations of this proposed rule for each of the modes, the most
obvious is a safety violation. In particular, if identifier-priority
reports a nonzero safe priority for an identifier naming a standard
procedure, a reference to that identifier should not evaluate to an unsafe
version of the standard procedure.
> Is it all right for an implementation to make the
> identifier-priority procedure return a pseudo-random
> integer in the range [0,3], no matter what declarations
> the compiler is recognizing?
I prefer not, as my answers to your first two questions above indicate.
Also, if we say that an implementation returns "the implementation
default" priority for a mode when declarations of that mode are ignored,
then returning a pseudo random priority when declarations are ignored
would be inappropriate.
> I assume the answer is "yes" to all three questions,
> but I want to make sure I'm not missing something
> here.
All of this is open to debate, of course, and if you have good arguments
supporting this position, please advance them.
Kent
More information about the R6RS
mailing list