Feature, implement :main command

Neil Mitchell ndmitchell at gmail.com
Sun Oct 30 15:13:02 EST 2005


> 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


More information about the Cvs-hugs mailing list