Dealing with configuration data

Dean Herington heringto@cs.unc.edu
Fri, 27 Sep 2002 12:56:38 -0400


Andrew J Bromage wrote:

> There's also a much uglier solution which I occasionally use if I
> need an "ad hoc" global variable.  Rather than using IORefs, I use
> Strings as keys.  The code is here:
>
>         http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/hfl/hfl/ioext/

I'm not sure why you consider the code you refer to above so ugly.  In any
case, I have a question and a comment on it.

Question:
Why do you use `seq` on `globalTableRef`?

Comment:
You use `addToFM` to replace entries in your table.  Without additional
logic to increase strictness, I think you unnecessarily risk stack
overflow.  Consider the case where `writeIOGlobal` is used many times on a
global between uses of `readIOGlobal` on that global.

The above issue raises a general question: How should strictness best be
achieved with `addToFM`?

 -- Dean