Dan Sugalski <[EMAIL PROTECTED]> wrote:At 8:17 PM +0200 7/13/03, Leopold Toetsch wrote:
I think one Env PMC ought to be enough. And that one may have e.g. an Iterator ettached, which simplest is done by deriving it from an hash like PMC.
Potentially, yes. We still ought not cache, since otherwise process environment changes made outside the interpreter won't register with us, which would be bad.
Which is AFAIK only possible for Win* and VMS.
Nope, not for this--I'm not talking about anything at all complex. Rather simple stuff like your code calls into a C library via the NCI interface, and that C code does a setenv().
This would allow caching as long as the Parrot_all_environ() returns the same pointer and the hash is built only on demand i.e. for accessing the whole %ENV. Iteration would use the hash (no changed keys of process environment during iteration are reflected in the env hash).
Perl 5 on VMS does this sort of thing now (building the full list needs spawning a subprocess, which is really annoying. Don't ask, you don't want to know) and it's problematic. The cost of fetching isn't much, and the cache just isn't worth the hassle.
--
Dan
--------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk