Browse thread
global record
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2006-07-20 (07:18) |
From: | Jeff Henrikson <jehenrik@y...> |
Subject: | Re: [Caml-list] global record |
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