From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 404E8BB83 for ; Thu, 20 Jul 2006 09:18:11 +0200 (CEST) Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k6K7IAHD021320 for ; Thu, 20 Jul 2006 09:18:10 +0200 Received: from frontend3.internal (frontend3.internal [10.202.2.152]) by frontend1.messagingengine.com (Postfix) with ESMTP id EF02DD914AB; Thu, 20 Jul 2006 03:18:02 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by frontend3.internal (MEProxy); Thu, 20 Jul 2006 03:18:04 -0400 X-Sasl-enc: wYgMenDaXfudU63w/RwLJ6e3iSxL+TuJBnAgGkMlgSSu 1153379876 Received: from [192.168.0.2] (70-56-73-79.tukw.qwest.net [70.56.73.79]) by mail.messagingengine.com (Postfix) with ESMTP id 1877583A2; Thu, 20 Jul 2006 03:17:55 -0400 (EDT) Message-ID: <44BF3017.6070701@yahoo.com> Date: Thu, 20 Jul 2006 00:26:15 -0700 From: Jeff Henrikson User-Agent: Mozilla Thunderbird 1.0.7 (Macintosh/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andreas Biegert Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] global record References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-j-chkmail-Score: MSGID : 44BF2E32.000 on nez-perce : j-chkmail score : X : 0/20 1 X-Miltered: at nez-perce with ID 44BF2E32.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; henrikson:01 jehenrik:01 emacs:01 emacs:01 binary:01 variants:01 config:01 variants:01 overwritten:01 command-line:01 beginner's:01 ocaml:01 beginners:01 bug:01 wrote:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: **** X-Spam-Status: No, score=4.4 required=5.0 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS,FORGED_YAHOO_RCVD autolearn=disabled version=3.0.3 The full generalization of this is dynamic scoping, as you may know. There's a discussion of the implementation in emacs in the emacs manual. Not thread safe but can be made so with an immutable binary tree, eg the Map module. You could map either strings or polymorphic variants to your config value type, probably a regular variant. I'm not sure how much of a performance savings polymoprhic variants would be over strings. For a couple of other approaches see http://caml.inria.fr/pub/ml-archives/caml-list/2004/12/a0924032de03d517cb8cb8f2adde6c94.en.html Jeff Andreas Biegert wrote: > Hi, > > I am developing a bioinformatics sequence analysis application which > contains about 20 modules. One of those modules, the 'Par' module, > encapsulates a record of about 30 configuration parameters needed > throughout the whole application. The parameter record is mostly > static but some values can be overwritten by command-line options. Is > there a way to make the (possibly modified) parameters record globally > accessable throughout all modules? This would be much more convenient > than having to pass the parameters record to virtually all functions > in my application. THX for helping. > > Andreas > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs