Greetings,
My biggest 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.
Another problem with declarations is that they are very very
implementation specific. The current set declarations may be
useless for some implementations, while other implementations may
need a different set. There is no one-size-fits-all set.
The original goal of R6RS was portability and code sharing. I don't
see how declarations help in this regard.
Recommendation: Implementation-specific features should be
implemented as libraries and not be part of the language proper. I
recommend that if declarations are going to stay, they should be
part of the (r6rs declarations) library which exports the |declare|
keyword as described in the document. Implementations that provide
implementation-specific declarations using implementation-specific
libraries can define the (r6rs declarations) library in terms of
their internal declarations. Moreover, implementations that do not
bother with declarations can simply expand (declare <spec>) to
(begin).*
Aziz,,,
* I know this is not even allowed as per R5.91RS since declarations
have to proceed definitions. (Rationale for this restriction is not
stated)
On Oct 26, 2006, at 2:59 PM, Jason Orendorff wrote:
> ---
> This message is a formal comment which was submitted to
> formal-comment_at_r6rs.org, following the requirements described at:
> http://www.r6rs.org/process.html
> ---
> Summary: Declarations don't seem to be designed for real-world needs
> Name: Jason Orendorff
> Email: jason.orendorff_at_gmail.com
> Issue Type: Enhancement
> Priority: Minor
> Component: Declarations
> Version: 5.91
>
> R5.91RS declarations strike me as odd. The common use case for this
> sort of feature is to make a debug build and a release build of the
> same code. In this use case, users often want debug builds to have
> extra runtime checks (read: asserts) and sometimes extra debug output.
> Other use cases are extremely rare, in my experience, especially for
> anything higher-level than a device driver.
>
> This leads me to the following thoughts:
>
> 1. Source code is not a useful place for this sort of information.
>
> 2. The level of fine-grained expressivity provided by (declare) seems
> excessive. As a user, I never need anything beyond a single switch:
> "safe" vs. "fast". Even searching Makefiles for instances of gcc
> compiler flags fails to bring up anything much more exotic than -O2.
>
> 3. To support the dominant use case, R6RS would need to allow code to
> "see" the settings under which it's compiled. You can't implement an
> (assert) macro in R5.91RS, for example.
>
> There seems to have been a lot of discussion on r6rs-editors about
> "safe" and "unsafe", but not much about declarations as a language
> feature. The two are independent; R6RS could-- and perhaps should--
> specify safe and unsafe modes without (declare) and the rest.
>
> -j
>
>
> _______________________________________________
> r6rs-discuss mailing list
> r6rs-discuss_at_lists.r6rs.org
> http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
Received on Sat Oct 28 2006 - 04:50:14 UTC