Subject: Re: A modest proposal (long) From: Erik Naggum <erik@naggum.no> Date: 2000/03/01 Newsgroups: comp.lang.lisp Message-ID: <3160943130779380@naggum.no> * Bill Newman | It's not just a beginner problem. The program | (DEFUN FOO (X) (BAR X)) | (DEFVAR X) | means something different from | (DEFVAR X) | (DEFUN FOO (X) (BAR X)) | And if the DEFVAR is in one file, and the DEFUN is in another, then the | semantics change silently depending on what order you compile them in. I maintain that this is a beginner problem, only. real Lisp programmers don't call their global variables "X". real Lisp programmers use packages if they want their symbols to stay of other people's face. real Lisp programmers know about unintern, too. | I'd say this is a design flaw that makes them not particularly safe. it's a design flaw to you because your notion of safe is wrong. | (By the way, I've considered making SBCL issue STYLE-WARNINGs for any | SPECIAL use of non-*FOO*-style symbols, and any non-SPECIAL use of | *FOO*-style symbols, to detect problems like this. But I'm a little | uncomfortable embedding informal naming conventions in the compiler, so | I've avoided doing this so far. Does anyone have any opinions on whether | such STYLE-WARNINGs would be The Right Thing?) I have already said what I think is the right thing here: demand that there be lexically apparent declarations that reiterate the special status of symbols so declared globally. lacking such a declaration, you might issue a style-warning for free variables even if you know they are globally declared special. it will lead to slightly more verbose code, but the excuse to be making invisible, pervasive changes would go away. | Yes, I also really wish there was a standard way to query "is symbol FOO | special?" And "what's the value of the optimization property BAR?" too.. precisely, and this is the _only_ problem worth solving as I see it. #:Erik