From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.user Subject: Re: Req for help on objects and environments Date: Wed, 22 Sep 2004 19:07:24 +0200 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <1095872844.3468.35.camel@localhost> References: <1094027329.4057.78.camel@kuzgun> <1094237209.3785.48.camel@lark> <87y8j3tkm8.fsf@zagadka.ping.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1095924877 24029 80.91.229.6 (23 Sep 2004 07:34:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 23 Sep 2004 07:34:37 +0000 (UTC) Cc: Guile Users Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Sep 23 09:34:21 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CAO7P-00052V-00 for ; Thu, 23 Sep 2004 09:34:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CAODQ-0007Hv-DV for guile-user@m.gmane.org; Thu, 23 Sep 2004 03:40:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CAODH-0007F8-Qg for guile-user@gnu.org; Thu, 23 Sep 2004 03:40:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CAODG-0007Ej-2j for guile-user@gnu.org; Thu, 23 Sep 2004 03:40:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CAODF-0007EM-VN for guile-user@gnu.org; Thu, 23 Sep 2004 03:40:22 -0400 Original-Received: from [216.166.232.203] (helo=johnson-resources.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CAO76-0004Gz-1J for guile-user@gnu.org; Thu, 23 Sep 2004 03:34:00 -0400 Original-Received: from localhost (mantis.schoolnet.na [::ffff:196.44.140.238]) (AUTH: LOGIN wingo) by johnson-resources.com with esmtp; Thu, 23 Sep 2004 03:33:47 -0400 id 001201C4.41527C5E.00003CCB Original-Received: from wingo by localhost with local (Exim 3.36 #1 (Debian)) id 1CAAan-0002q8-00; Wed, 22 Sep 2004 19:07:45 +0200 Original-To: Marius Vollmer In-Reply-To: <87y8j3tkm8.fsf@zagadka.ping.de> X-Mailer: Evolution 1.5.93 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:3470 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:3470 Hey Marius, On Tue, 2004-09-21 at 22:47 +0200, Marius Vollmer wrote: > It is best not to fiddle with the implementation of lexical > environments (expect when you are writing a debugger, say). Something > like the following might be sufficient and is cleaner. [...] > (define-macro (with-env env . body) > (let ((module (current-module))) > `(let ((code (cons* 'let ,env ',body))) > (eval code ',module)))) > > (define env (make-environment 'a 12 'b 13)) > > (pk (with-env env (+ a b))) Yeah, I think I would have done this if I hadn't needed to keep state in the environment. I agree it's ugly though -- it would be impossible to compile this code, for instance, because it violates the implementation's prerogative to implement environments as they like. I should probably implement my stuff with anonymous modules. Regards, -- Andy Wingo http://ambient.2y.net/wingo/ _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user