From ... From: Erik Naggum Subject: Re: setq Question. Date: 2000/02/29 Message-ID: <3160842339136874@naggum.no>#1/1 X-Deja-AN: 591470679 References: mail-copies-to: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsmaster@eunet.no X-Trace: oslo-nntp.eunet.no 951859492 15481 195.0.192.66 (29 Feb 2000 21:24:52 GMT) Organization: Naggum Software; vox: +47 8800 8879; fax: +47 8800 8601; http://www.naggum.no User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.5 Mime-Version: 1.0 NNTP-Posting-Date: 29 Feb 2000 21:24:52 GMT Newsgroups: comp.lang.lisp * npak@kazbek.ispras.ru (Nick V. Pakoulin) | Will the binding created by setq become dynamic or lexical? setq doesn't create bindings, it modifies bindings. the binding modified by a top-level setq is the symbol-value slot of the symbol. if this symbol was previously unbound (i.e., it had no value), you might be confused about the resulting behavior into believing that something happened other than merely setting the symbols-value slot of the symbol, but nothing else actually happened. | I've looked about `setq' in the standard but there is nothing about it. | I tried CLISP and it looks like it makes variables in this case to be | dynamic. no, you're confusing an unbound variable with the creation of a binding. we've recently been through this, as well as several times in the past. some will tell you that this is a major big deal with Common Lisp -- don't listen to them. just note that the semantics of a top-level setq is well-defined, but confusing to people who don't realize that setting a free variable, whether the symbol is declared special or not, is operationally identical to setting the symbol-value slot of the symbol, and setting a lexical variable is not affecting the symbol-value slot of any symbol. the ultimate advice, however: it is not a good idea to use free variables without declaring them special or knowing _exactly_ what's going on. #:Erik