Fergus Henderson <[EMAIL PROTECTED]> writes:
>
> 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.
>
It is constant within the lexical scope of an executing program;
that's constant enough for me, your mileage may vary.
...
> 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.
>
Nothing nefarious, I'm afraid. The change from Gofer to Hugs was done
to avoid residual CAF garbage building up (the simplest way of implementing
CAF GC - I think Nottingham and Yale are discussing how to do this
properly).
Re: argv in a command-line interpreter, it is not obvious why you want to
change argv from within an eval prompt - to configure the invocation of
Hugs, yes, but not to set the command-line options for later evaluations.
(last time I looked, Hugs had System.getArgs defined to always return [])
The latest beta release of Yale Hugs support the use of it as a
command-line tool, i.e., a silent option causes it to suppress all
interpreter
output, reading just expressions to evaluate from stdin and output their
results on stdout. Perhaps the command shell is a more appropriate
place from where to change argv?
--Sigbjorn