Tommy Thorn writes
| Jens' question gave my a perfect opportunity to open my a pet peeve of 
| mine: the ditatorship of `Main'.
| 
| In Haskell, the `main' function must reside in the `Main' module.
| Add to this that the `Main' module must reside in a `Main' file and
| you have an unfortunate consequence that you can only have one `Main'
| function in each directory.  This in turn means that to have, for
| example several variants of a program, you *must* defer to either
| messing with a preprocessor or dealing with multi-directory
| compilation, not a pretty sight in either case and especially daunting 
| to a beginner.
| 
| In this Haskell is in contrast to most other popular programming
| language.  The alternative seems quite straightforward and there are
| no technical difficulties:
| 
|   1) Accept the `main' function can be put in any module, and/or
|   2) Introduce a nothing of "anonymous" modules, of which the file
|      name can be anything.
| 
| I'd prefer 1) alone.  
| 
| /Tommy
| 

I heartily concur.  I have always disliked the requirement for the
module-name "Main".  To me, it reeks of PL/I:

        main: procedure options(main);

Department of Redundancy Department

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