Keean Schupke <[EMAIL PROTECTED]> writes:

> Surely both requirements can be satisfied if the programs arguments are made
> parameters of main:
>
> main :: [String] -> IO ()

>From info '(libc)Error Messages', about program_invocation_name
and program_invocation_short_name:

   *Portability Note:* These two variables are GNU extensions.  If you
want your program to work with non-GNU libraries, you must save the
value of `argv[0]' in `main', and then strip off the directory names
yourself.  We added these extensions to make it possible to write
self-contained error-reporting subroutines that require no explicit
cooperation from `main'.

This suggests that making global parameters available only as
arguments of main would be a bad idea. But they should be settable,
to account for the rare case of wanting to substitute something else
to a library which reads them itself.

-- 
   __("<         Marcin Kowalczyk
   \__/       [EMAIL PROTECTED]
    ^^     http://qrnik.knm.org.pl/~qrczak/
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to