Re: Feature, implement :main command

Neil Mitchell <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.hugs
Message-ID <[email protected]>
> Sorry, I meant withArgs -- setArgs is internal.  But instead of resetting,
> how about making setting the args the whole function of the new command,
> so then they can run main (or anything else) several times with the same
> argument?

This is mainly motivated by my recent development work - I kept ending
up with a function called main2 which is called by main with the
arguments, so I could develop it more easily. A :main removes this
need, if only :args was available then it would require twice as many
commands, i.e. :args blah, main, if you were continually changing the
arguments. Also, this way main more closely models the Clean approach,
where command line arguments are passed into main, not in a monad.

However, having :args as well might be quite handy.

>  (I'm not sure what WinHugs interface you had in mind.)
Currently the run button when the user has typed no expression runs
'main', I intend to change this to ':main'

Thanks

Neil
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.