[m-rev.] diff: io.get_environment_var on java

Paul Bone pbone at csse.unimelb.edu.au
Thu Aug 13 16:26:50 AEST 2009


On Thu, Aug 13, 2009 at 02:36:55PM +1000, Peter Wang wrote:
> On 2009-08-13, Paul Bone <pbone at csse.unimelb.edu.au> wrote:
> > 
> > Without thinking about it too hard I can think of the following pros and cons.
> > 
> > Pros:
> >     + It means one can export environment variables to child processes.
> >     + set_environment_var has consistent behaviour across more backends.
> > 
> > Cons:
> >     + It's more work, if we get what we want with less work then that's easier.
> >     + If a programmer uses other foreign code to start child processes
> >       environment variable bindings won't be exported.  This may not be what
> >       programmers expect.
> > 
> > Why do you say we shouldn't do this?
> 
> Because of the second con.  io.set_environment_var will appear to work
> until someone mixes Mercury and Java code, possibly resulting in a
> subtle bug.
> 
> On the other hand we could add a version of io.call_system with takes a
> list of environment variables, then people who need portability to Java
> can use that instead.

If we follow this sort of a solution code will be less bandend-portable.
Programmers will have to be aware of which backends they are using.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 489 bytes
Desc: Digital signature
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20090813/b3268992/attachment.sig>


More information about the reviews mailing list