On Wed, Oct 26, 2011 at 5:41 PM, Scott L. Burson Scott@sympoiesis.com wrote:
On Wed, Oct 26, 2011 at 10:12 AM, Alessio Stalla alessiostalla@gmail.com wrote:
I don't think a symbol for which there is no special declaration in scope can be considered to name a dynamic variable, and thus to have a value cell at all.
On a strict reading, you're probably correct. But I had never seen an implementation for which this was not the case.
I'm not sure a strict reading would have that. Symbols can have value attributes, and value attributes are accessed by symbol-value [1]: "If a symbol has a value attribute, it is said to be bound, and that fact can be detected by the function boundp. The object contained in the value cell of a bound symbol is the value of the global variable named by that symbol, and can be accessed by the function symbol-value. A symbol can be made to be unbound by the function makunbound."
Symbol-value [2] accesses a symbol's value attribute, and it's explicitly mentioned that unbound issues only occur on reads: "Should signal unbound-variable if symbol is unbound and an attempt is made to read its value. (No such error is signaled on an attempt to write its value.) " I'd think, then, that as long as some symbol-value is written first, reading shouldn't be a problem.
The issue with symbol-macros and special variables still stands of course. But I don't think that a symbol needs to be declared as a special variable in order for its symbol-value to be set and read.
//JT
[1] http://www.lispworks.com/documentation/HyperSpec/Body/t_symbol.htm#symbol [2] http://www.lispworks.com/documentation/HyperSpec/Body/f_symb_5.htm#symbol-va...