Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: raja naresh <rajanaresh89 <at> gmail.com>
Subject: Special Variables
Newsgroups: gmane.lisp.clisp.general
Date: Monday 7th November 2011 05:09:33 UTC (over 6 years ago)
Hey guys,

I have a question regarding special variables.

(do ((var 'nil))
      ((equal var '(a b c)) var)
      (setf var (append var '(a b c))))

The above code returns '(a b c).
But when I define a function

(defun func () (setf var (append var '(a b c))))

and do the following:

(do ((var 'nil))
      ((equal var '(a b c)) var)
      (func))

 The interpreter gives me an error

*** - SETQ: variable VAR has no value

Isn't VAR supposed to be a special variable for FUNC which is in the scope
of DO function. I am pretty sure I am missing some concept here. Any kind
of help is appreciated. Thank you.

Regards
Raja Naresh
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
clisp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-list
 
CD: 2ms