From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.ulv.nextra.no!nextra.com!uio.no!nntp.uio.no!ifi.uio.no!not-for-mail From: Erik Naggum Newsgroups: comp.lang.lisp Subject: Re: Accessing enclosed symbol. Date: 18 Oct 2002 16:57:51 +0000 Organization: Naggum Software, Oslo, Norway Lines: 44 Message-ID: <3243949071853368@naggum.no> References: <3243851599697469@naggum.no> <3243942528333317@naggum.no> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: maud.ifi.uio.no 1034960272 2723 129.240.65.5 (18 Oct 2002 16:57:52 GMT) X-Complaints-To: abuse@ifi.uio.no NNTP-Posting-Date: 18 Oct 2002 16:57:52 GMT Mail-Copies-To: never User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.lisp:44227 * Jacek Generowicz | OK, last try ... could you suggest a better subject line for my | original message? Well, no. What you try to do is almost trivial, as the snippet of code I wrote to handle it shows. But I think I understand why you think this is a big deal and I do not. You want to create a mini-environment in which you can refer to bindings in a slightly different way than normal lexical scope, and not quite in dynamic scope, either. However, I see no need to go outside the normal lexical scope as you have explained things so far and I am sort of waiting to hear more from you why you think so. Perhaps things could be eased for you with symbol macros? You can then set up an environment that will map a symbol to a function call that may well be a closure that captures the symbol's value from an environment other than your lexical environment. Symbol macros can be defined both globally and locally. See `define-symbol-macro´ and `symbol-macrolet´. Perhaps you really need a dynamic environment for your mini-"language"? Setting it up with `progv´ is easy and straightforward and if you make no internal bindings in your mini-language, will effectively be identical to a lexical environment created on the fly. You can then use `eval´, too. If I understand your problem description correctly, you have ventured down a blind alley and ask us to help you break through one of the walls around you. I try to help you turn back to where you came from and make a different choice. It is not unlike rats in mazes. Some quickly learn that scaling the walls does not work, while others do not. Some act like believers in their prior understanding of the concept and curse the walls (apologies for the anthropomorphism) and try to claw their way through them. Some figure out that blind alleys are no good and learn to spot them early enough that they do not have to back up very often. In human terms, the stronger you believe that you have found a good solution the more effort and setbacks you are willing to accept. You find people who go "this should do it! shit!" over and over. Sometimes, less faith in one's ability to intuit solutions before knowing the subject at hand can do wonders for the ability to find really good solutions. Also see my current and long-standing .signature. -- Erik Naggum, Oslo, Norway Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.