Re: Feature, implement :main command

Ross Paterson <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.hugs
Message-ID <20051030131347.GA10174__9265.21387086741$1130678107$gmane$org@soi.city.ac.uk>
On Sun, Oct 30, 2005 at 12:40:47PM +0000, Neil Mitchell wrote:
> Attached is a patch that adds a :main command to hugs. :main arguments
> is equivalent to arguments `withArgs` main, but easier to use because
> you don't need to import anything extra, and the arguments are parsed
> as if they were arguments - i.e. :main my test "of this", instead of
> ["my","test","of this"] `withArgs` main.

Well the Main module probably imports System.Environment anyway, but
I guess this is harmless, and presumably this will be used by some
WinHugs thing.

The usual way to parse arguments to Hugs commands is readFilename(),
which also allows backslashed quotes.  Using this would aid consistency,
but you'll need to work around the fact that it returns a string in
static storage.
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.