>>>>> "felix" == felix  <[EMAIL PROTECTED]> writes:

Felix,

felix> HI, there!

felix> I have a little problem with the "getArgs" function in Hugs/GHC.
felix> Something like

>> import System
>> 
>> main = do argv <- getArgs
>>           print argv

felix> prints "[]" (the empty list) and not the list of arguments.
felix> Since this is definitely not the right behaviour, I must be
felix> making a mistake.
felix> I'm using GHC-4.03 and Hugs98 on Windows 98.

felix> Any help with this one would be appreciated.

I haven't checked for ghc, but for hugs, check the source file
iomonad.c. There is a function primArgv, which will return the
appropriate element of hugsArgv. When hugs is run as an interpreter
(not through runhugs) hugsArgv points to defaultArgv, which in turn
points to a list containing only the String "Hugs" which will be
returned by getProgName. Do have a look at the source code its quite
elegantly written C code!

I think it would not be difficult to add a ":s" command to hugs to set
an argument list as you do in say gdb. 


Marko
-- 
Marko Schütz            [EMAIL PROTECTED]
http://www.ki.informatik.uni-frankfurt.de/~marko/


Reply via email to