Sigbjorn Finne wrote:

[Regarding `performOnceBeforeMain' / `pseudoconstant':]

> - It's an interesting idea, but before delving into some of the
>   more specific problems with it, is it really solving a general
>   enough problem? [...] Are there other compelling, general uses
>   of the construct?

Well, there's at least one other than argv: you mention it yourself, below.

> - You want to restrict the use of `performOnceBeforeMain' to
>   toplevel constants only, and Phil's use of a declaration is
>   a good way to enforce this.

Yes, I agree.

> - When will the init actions be performed? At program startup?
>   What if your system dynamically loads code? Do you have to
>   hoist these modules in wholesale at startup, or do you rely on a
>   sufficiently expressive format for your dyn.libs? (e.g., ELF).

Note that it is quite possible for the language implementation
to handle per-module initialization, even if this is not directly
supported by the underlying executable format.  For example, all C++
and Ada compilers must be able to do this.  Doing a good job of it
might add a bit to the required implementation effort, though.

> - The construct makes it possible to express the following:
> 
>      pseudoconstant foo newVar
> 
>   A global variable...

Great!  There's your other compelling, general use.

>   Sure, you could impose restrictions [to prevent this]

But why would you want to do that?

-- 
Fergus Henderson <[EMAIL PROTECTED]>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED]         |     -- the last words of T. S. Garp.




Reply via email to