Formal comment #77 (enhancement) Querying Declaration Quality Priorities Reported by: Michael Lenaghan Component: Declarations Section: 9.22 (pg 56) Summary Developers should have access to declaration quality priorities so that developer code can take the current value into account. Description Chez Scheme has an optimize-level parameter. The value of optimize-level can be both read and written. Currently, optimize-level 3 means that the compiler is allowed to generate unsafe code. Developers can query the value of optimize-level at expansion time so that expanded code takes the current setting into account. For example, in Chez Scheme it's possible to write code like this: (define-syntax define-something (lambda (e) (syntax-case e () [(_ (field ...)) (with-syntax ([no-type-check (>= (optimize-level) 3)]) #'( (if (or no-type-check (check-type? )) ) )]))) Chez Scheme itself uses an approach like this to avoid record type checks in record field accessors when expanding records at optimize-level 3. To write code like this--especially in a portable way--developers need access to the current values of the declaration qualities. RESPONSE: In response to a different formal comment, declarations will be dropped from the report. The second sentence of section 4.4 will be revised to say something like "Libraries and scripts that import only from safe libraries are also said to be safe." The last sentence of section 4.4 will be revised to something like "Implementations may provide access to unsafe libraries, and may provide other implementation-specific facilities that cannot guarantee safety." Implementation-specific facilities may also be mentioned in a non-normative appendix. The report will abandon the second half of the guiding principle stated in the R6RS Status Report of June 21, 2006, that R6RS Scheme should: * allow programmers to rely on a level of automatic run-time type and bounds checking sufficient to ensure type safety while also providing a standard way to declare whether such checks are desired;