From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Kraft Newsgroups: gmane.lisp.guile.devel Subject: Re: Elisp lexical-let Date: Fri, 24 Jul 2009 08:50:10 +0200 Message-ID: <4A6959A2.8090908@domob.eu> References: <4A661B73.4090706@domob.eu> <4A66D7BF.5060606@domob.eu> <4A683FB9.50806@domob.eu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1248418202 11555 80.91.229.12 (24 Jul 2009 06:50:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Jul 2009 06:50:02 +0000 (UTC) Cc: Ken Raeburn , guile-devel , Neil Jerram To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jul 24 08:49:55 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MUEbJ-0001yO-Ks for guile-devel@m.gmane.org; Fri, 24 Jul 2009 08:49:53 +0200 Original-Received: from localhost ([127.0.0.1]:52626 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MUEbJ-0000Ta-2j for guile-devel@m.gmane.org; Fri, 24 Jul 2009 02:49:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MUEbH-0000TT-5M for guile-devel@gnu.org; Fri, 24 Jul 2009 02:49:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MUEbC-0000PZ-HZ for guile-devel@gnu.org; Fri, 24 Jul 2009 02:49:50 -0400 Original-Received: from [199.232.76.173] (port=52856 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MUEbC-0000PO-CE for guile-devel@gnu.org; Fri, 24 Jul 2009 02:49:46 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:34859) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MUEbB-000731-Nw for guile-devel@gnu.org; Fri, 24 Jul 2009 02:49:45 -0400 Original-Received: from taro.utanet.at ([213.90.36.45]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MUEbA-0000Q2-M6 for guile-devel@gnu.org; Fri, 24 Jul 2009 02:49:44 -0400 Original-Received: from pam.xoc.tele2net.at ([213.90.36.6]) by taro.utanet.at with esmtp (Exim 4.69) (envelope-from ) id 1MUEb6-0003tP-GV; Fri, 24 Jul 2009 08:49:40 +0200 Original-Received: from d83-187-186-129.cust.tele2.at ([83.187.186.129] helo=[192.168.1.18]) by pam.xoc.tele2net.at with esmtpa (Exim 4.69) (envelope-from ) id 1MUEb6-0000Zb-Bu; Fri, 24 Jul 2009 08:49:40 +0200 User-Agent: Thunderbird 2.0.0.0 (X11/20070425) In-Reply-To: X-Detected-Operating-System: by mx20.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:8958 Archived-At: Andy Wingo wrote: >> I'll keep in mind also the lexbind idea of optionally making every >> binding lexical. Andy, can you give me a hint/example/pointer how >> compiler options work? This would be exactly the place to provide this, >> I think. Additionally we could add an option to remove the "variable is >> void" error check for a further performance gain. > > They don't work! Well, basically they're just a value that reaches the > compiler somehow. I think they are a keyword list: (#:foo bar #:baz qux) > etc. They are set via the #:opts argument to compile; I don't know if > you can set them from the command line. I was waiting for a use case :) thanks for the hints, I did some tests yesterday, and it seems that I can just provide whatever value I want to (compile ... #:opts ) and get this as opts of the compiler routine called. I've never used keyword lists before, but I'll look them up and this seems like what we want. So far I'm thinking about two possibly useful options: 1) Declare to disable void checks for certain variables or all (for performance, as already written). Stuff like makunbound/boundp will sill work just as before, but accessing a variable that is void will not give an error but rather return the special void value. As most code should not really depend on this void-error anyways, it seems reasonable to give at least a way to disable this check happening on each and every variable access for no good (except debugging maybe). 2) Declare that certain variables or all should always be bound lexically rather than dynamically; maybe a defvar construct will retract this and make it dynamically bound later on again, then this should be like the upcoming lexbind stuff in emacs. As lexical-let is not everything, but function arguments are always dynamically bound (except if we provide a lexical-lambda... hm, it might even be useful at times!) -- and this spoils tail-calls -- both of this option and lexical-let will probably be useful. And maybe others in the future, but I've no ideas so far. It seems that options work basically, but I guess there's not yet a way to "set" them for compilation happening for the elisp-repl? This means that I can just keep on implementing and testing them, but for real use we probably want some construct to set them for real uses (besides (compile ...)) as well. Cheers, Daniel -- Done: Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz To go: Hea-Kni-Mon-Pri