[Haskell-cafe] Re: [Haskell] Re: Global Variables and whatever

Adrian Hey ahey at iee.org
Tue Nov 9 01:24:48 EST 2004


On Monday 08 Nov 2004 9:53 pm, Keean Schupke wrote:
> What did you think of the code example given where the one-shot nature is
> provided by a 'C' wrapper around the FFI function. I think this is the best
> solution...

As a pragmatic solution to this (and only this) particular problem it's OK.

But let's not pretend the real problem has gone way (or just doesn't exist)
as a result of this. There are many reasons why people might need top-level
TWIs. You asked for a simple example and I provided one, that's all.

Also note that Roberts solution still requires the use of a top level
mutable variable. I take it the position of those who object to such
things is not..

 "Top level mutable variables are a very very bad thing and
  should never ever be used (Errm..well unless they're really
  necessary, in which case you should use C)."

Now that would be strange. I would call that "militant denial".

As a side note (not specifically directed at you) I would also
like folk to take note that the mutable variable used in Roberts
solution is top level, but is NOT global.

As I have observed in an earlier post, the thread title
chosen by the OP is a rather unfortunate choice of words IMO.
I wish people stop talking about "global variables". Nobody is
advocating the use of global mutable variables. I sure hope I'm
not going to have to repeat this (yet again!).

Actually, I know I'm not going to have to repeat this yet again
because I'm going to make this is my last post on this thread.

Regards
--
Adrian Hey



More information about the Haskell-Cafe mailing list