Suppose there are three modules, all defining 'main':
A.main, B.main, C.main. Which is to be treated as 'the' main?

And if the module shouldn't be called 'Main' why should the value
be called 'main'?  Maybe you want

        ghc *.o -main A.wibble

to treat A.wibble as the main function.  But then it would
be hard to check that A.wibble had the correct type.

One could also specify that option when compiling A, I suppose

        ghc A.hs -main wibble

to say 'treat A.wibble' as main.

Simon

> More seriously, C (I believe) established the convention of a main
> routine named "main", but did not require that it be defined in a
> file named "main.c".  (The file name is the closest analogue to our
> module name in classic C.)  A Java application must have a method
> named "main", but the class name is not restricted.
> 
> Cheers,
> --Joe
> 
> 
> Joseph H. Fasel, Ph.D.              email:  [EMAIL PROTECTED]
> Technology Modeling and Analysis    phone:  +1 505 667 7158
> University of California            fax:    +1 505 667 2960
> Los Alamos National Laboratory      postal: TSA-7 MS F609
>                                             Los Alamos, NM  87545
> 


Reply via email to