Sigbjorn Finne, you wrote:
> 
> ... the issue here is *not* how you configure your programs, there's more
> than one way to do that (to paraphrase the Perl slogan), but the fact that
> argv is *constant* and should be provided as such. I've yet to see a
> post contending that argv isn't.

I pointed out that although argv is constant over any single program
execution, it variables from execution to execution, so it's not
really constant.

Note that there are existing functional language implemenations, in
particular Gofer, that assume that constants are really constant, not
just constant over each program execution.

For example, the following Gofer program

        x = 42
        y = x + x
        main = appendChan stdout (show y) abort done

requires fewer reductions when you run it the second time around,
because `y' has already been evaluated.

The behaviour of Hugs is different in this respect (why? was it
changed to support hacks such as `argv = unsafePerformIO getArgs'?).
It appears that in Hugs, CAFs are reset whenever you get back
to the command prompt; evaluating `y' twice gives you the
same number of reductions in both cases.

Requiring the Hugs behaviour could (a) make implementing Haskell slightly
more difficult and (b) reduce efficiency, for interpreters and JIT
compilers.

-- 
Fergus Henderson <[EMAIL PROTECTED]>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED]         |     -- the last words of T. S. Garp.



Reply via email to