static parameters

Robert Fraser fraserofthenight at gmail.com
Wed Sep 5 11:21:52 PDT 2007


Bruno Medeiros Wrote:

> The first thing that struck me with this change was this clear > inconsistency:
> The static parameters are really compile time constants, but they are 
> declared with 'static'. However, outside of function parameters, 
> compile-time constants are declared with invariant and const (as 
> "storage classes").

Actually, I think this is a problem with the const and invariant terminology. "const" doesn't mean compile-time constant, it means read-only reference. "invariant" means "constant after declaration, can be stored in ROM," but doesn't need to be compile-time resolvable. Plus, both these storage clases already exist, and "static" is a catch-all keyword for any feature not worth adding a real keyword for and doesn't really fit with anything else.



More information about the Digitalmars-d mailing list