Re: Declaring *print-case* special in SBCL seems broken



Ron Garret wrote:

Christophe Rhodes <csr21@xxxxxxxxx> wrote:

10. Declaring or proclaiming it special (via declare, declaim, or
proclaim).

I'm not aware of an exception in the standard.

Well, there's this:

11.1.2.1.2.1 Some Exceptions to Constraints on the COMMON-LISP Package
for Conforming Programs

In particular:

"...if an external symbol of the COMMON-LISP package is globally defined
as a standardized dynamic variable, it is permitted to bind or assign
that dynamic variable..."

Says absolutely nothing about declarations, so the point is moot. (And
SBCL indeed allows you to bind and assign these variables as the
chapter and verse you site requires.)

There's also common sense: in light of the fact that *print-case* is a
dynamic variable, declaring it special is a no-op and thus ought not to
be an error.

Now THIS is a perfectly valid point.

My reasoning in making the package locks disallow this (IIRC) involved
two main factors:

1. Less exceptions to the rules. The CLHS rules which serve as
foundations for the package locking rules are already complicated
enough. Adding one more exception would in this case have lessened the
transient pain, but made mastery
of the full ruleset more difficult.

2. What is the user trying to do? Declaring a special a special is not
just a no-op, but also nonsensical, and it seems likely that the user
is trying to do something misguided, so an early warning is
likely to be a good idea. (Notably, if you are building a binding
construct that implicitly declares everything locally special it would
definitely be a good idea to not do that to symbols in the COMMON-LISP
package.)

If you disagree with either of these I'm quite interested in hearing
about it, but preferably on sbcl-devel.

Cheers,

-- Nikodemus Siivola

.



Relevant Pages

  • Re: Declaring *print-case* special in SBCL seems broken
    ... The SBCL Manual, Node "Package Locks" ... Going to the referenced ANSI Standard section reveals, ... Some Exceptions to Constraints on the COMMON-LISP Package ... declaring it special is a no-op and thus ought not to ...
    (comp.lang.lisp)
  • Re: Limited returns
    ... Well, I thought the compiler must warn about possible exception, ... package Named is ... function Create(name: String) return Object; ... package Factory is ...
    (comp.lang.ada)
  • Re: While statement
    ... public static void main throws IOException ... private means that no other classes can acces this particular class, ... And when you only need one or two classes from a package, ... You shouldn't have a method throw an exception unless ...
    (comp.lang.java.programmer)
  • Re: About String
    ... Only if the programmer specifies the exception contracts separately for the declarative parts and the statements. ... exception <handle exceptions raised in the declarations> ... the exception handler could execute any sort of non-erroneous code that could be executed in any subprogram called as part of the declarations in package A. For example, it could set some flag in another package to inform the application that package A cannot be used because its elaboration failed. ...
    (comp.lang.ada)
  • First day with production development on D2005
    ... first time, but acceptable until the next major version. ... Exception info sending to QC. ... it did create the bpl and dcp file for the design time package. ... And there is no error when installing or compiling the package. ...
    (borland.public.delphi.non-technical)