| Maybe the symbol table isn't passed around to all dark corners though.

Dead right it ain't. There are plenty of places you don't need a symbol
table.

| Anyway, what it seems to me you lose by doing it the way you described
| is that you are stuck again if some day you want to set those flags
| some other way than from the environment variables. For example with
| pragmas. You can't compile several modules with different settings
| either, without restarting all of the compiler, it seems to me.

I regard this as an *advantage*.  If I see

        import CmdLineOpts( myFlag )

        f x = if myFlag then <A>
              else <B>

then I *know* that every call to f will behave like <A>, or
every call will behave like <B>.  No chance that some may behave like
one and some like the other.

If I pass the flags as an argument, thus:

        f flags x = if (lookup "myFlag" flags) then <A> 
                    else <B>

then I can draw no such conclusion.

The point is, if I *want* to have several behaviours in one run I can
always use this second technique.  But Haskell as it now stands prevents
me from using the first, even when I *don't* want several behaviours in one
run.  I'd be prepared to pay the pain if I wanted the benefit.  Since I
don't want the "benefit" I don't want the pain.  

This message has clarified that there are three (not two) reasons
that argv should be constant

        1.  Easier programming
        2.  Faster running
        3.  Extra reasoning ability (this the new one; every call to
            f will behave the same way)

Simon



Reply via email to