[r6rs-discuss] [Formal] Declarations do not belong in the report

From: MichaelL_at_frogware.com <MichaelL>
Date: Thu Nov 16 01:15:30 2006

> A big problem with declarations is that the way they're specified,
> they do not follow any scoping rules. This is especially true in
> the presence of macros: when one library with one declaration
> exports a macro that is used in another library using a different
> set of declarations. There is just no meaningful way in which the
> programmer can specify the extent of a declaration or know how a
> single declaration in one library is going to affect the rest of the
> program.

Yes, scoped declarations would be very useful. In Chez we typically
compile the overall program at optimize-level 2, but there are individual
procedures or modules that we want to compile at optimize-level 3.

I suppose it would be like having "compiler-let". Well, in our case more
like "fluid-compiler-let" since we want the setting to take effect during
expansion and since we want to return to the original value. Declarations
would then be like defines that are transformed into fluid-compiler-lets.

But from my own experience in Common Lisp I'd say that the definition of
the declarations doesn't have to be air tight. Most of what a compiler
does is invisible anyway. A statement that "I care about safety here" and
another about "I care about speed more than safety here", for example, is
workable.
Received on Thu Nov 16 2006 - 01:15:18 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:00 UTC