[R6RS] Safe/unsafe mode

William D Clinger will at ccs.neu.edu
Tue Jul 11 14:23:07 EDT 2006


For the record, I define unsafe code as

  * all code within a library that contains a (safe 0)
    or unsafe declaration at its head, excepting nested
    bodies that contain a safe or (safe n) declaration,
    where n > 0, at their head;
  * all code within a body that contains a (safe 0) or
    unsafe declaration at its head, excepting nested
    bodies that contain a safe or (safe n) declaration,
    where n > 0, at their head.

For the record, the semantics I prefer for unsafe code is
simply this:

If unsafe code does not do anything that might generate an
exception or cause unspecified behavior had the unsafe
declarations been absent, then the behavior of unsafe code
is the same as some legal behavior for safe code.

If unsafe code does something that might generate an
exception or cause unspecified behavior, then all bets are
off.

Will



More information about the R6RS mailing list