From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Viktor Pavlenko Newsgroups: gmane.lisp.guile.user Subject: fluids for dynamic scoping Date: Tue, 8 Apr 2003 22:22:27 -0400 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <16019.33763.611815.578236@shmyh.ua> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1049855062 1696 80.91.224.249 (9 Apr 2003 02:24:22 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 9 Apr 2003 02:24:22 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Apr 09 04:24:20 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1935G4-0000R8-00 for ; Wed, 09 Apr 2003 04:24:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 1935Ft-00009R-05 for guile-user@m.gmane.org; Tue, 08 Apr 2003 22:24:05 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 1935Ex-0007tF-00 for guile-user@gnu.org; Tue, 08 Apr 2003 22:23:07 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 1935Ep-0007nw-00 for guile-user@gnu.org; Tue, 08 Apr 2003 22:22:59 -0400 Original-Received: from cpe00485488312e-cm024460001318.cpe.net.cable.rogers.com ([24.156.154.176] helo=shmyh.ua) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 1935EO-0007DM-00 for guile-user@gnu.org; Tue, 08 Apr 2003 22:22:33 -0400 Original-Received: by shmyh.ua (Postfix, from userid 502) id ACF8BE627; Tue, 8 Apr 2003 22:22:27 -0400 (EDT) Original-To: guile-user@gnu.org X-Mailer: VM 7.11 under Emacs 21.2.1 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: General Guile related discussions List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:1780 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1780 Hello, I intend to use with-fluids to simplify a data structure creation (see below). However, after reading some discussions in the mailing list archives regarding inherent "incorrectness" of fluid-let, I now have doubts if the following code is OK. Is there any way to achieve similar behavior without fluids? ------------------------------------------------------------------>8 (use-modules (ice-9 optargs)) (define a-field-default (make-fluid)) (define (make-my-record . args) (let-keywords args #f (id name (a-field (fluid-ref a-field-default))) (list (cons "ID" id) (cons "NAME" name) (cons "A-FIELD" a-field)))) ... (with-fluids ((a-field-default 'ABC)) (list (make-my-record #:id 0 #:name "zero") (make-my-record #:id 1 #:name "one") (make-my-record #:id 2 #:name "two") ... (make-my-record #:id 99 #:name "special" #:a-field 'XYZ))) ... ------------------------------------------------------------------>8 Thank you in advance for any insight. -- Viktor _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user