Phil Wadler wrote:
> If it's a problem, let's find a general solution.
>
> One possible solution is a new declaration, of the form:
>
> pseudoconstant <name> <expr>
>
> where <expr> has type (IO t), and <name> is declared with type t.
> (Pick a different keyword if you prefer.) The only tricky issue is
> the order in which the commands of type (IO t) are executed. They
> should clearly precede main, but how should they relate to each other?
> It seems reasonable to restrict this declaration to appear in the same
> module as main, in which case the textual order is sufficient.
There is a "general solution" in a different world:
In Ada, each module (package), not only "main", can have an
"elaboration procedure" which is implicitely called once, before any
access to anything declared in the package. Of course determining
elaboration order is tricky (the Reference Manual is a thick volume).
--
Johannes Waldmann Institut für Informatik FSU D-07740 Jena Germany
http://www5.informatik.uni-jena.de/~joe/ mailto:[EMAIL PROTECTED]
"... oder wie lautet denn der Titel Ihrer Dissertation?" - "Ich schreibe
ueber `Besonderheiten von Stil und Rhythmik weiblicher Prosa des spaeten
Chejan, dargestellt an Makurano-Soshi'", sagte Pfeffer. "Ich fuerchte,
dass..." - "Aus-ge-zeich-net! Genau das, was wir brauchen."