version and extern problems

BCS ao at pathlink.com
Tue Jul 10 15:29:54 PDT 2007


Reply to Walter,

> Jarrett Billingsley wrote:
> 
>> "Walter Bright" <newshound1 at digitalmars.com> wrote in message
>> news:f70mvo$22e7$1 at digitalmars.com...
>> 
>>> It's the old chicken-and-egg problem of forward references.
>>> 
>> Mind elaborating?  I can't see how this is a forward reference issue.
>> 
> Sure. What if the string is a const string defined after it is used?
> 

That is one thing I have never understood: why does lexical order ever (outside 
of statement lists e.i. function) ever cause an issue?

I would expect that all of these issues could be removed by having one pass 
over the AST find the symbols (without getting types or anything else). Then 
another pass starts filling them out by reclusively evaluating symbols.

The only issue I see right off involve non-determinism of some things like 
static asserts and ifs and how errors are found. But I think that that could 
be removed (or rendered irrelevant) for cases where errors aren't present.

Then again, my experience with compilers stops just barely after lexers.

However I /am/ genuinely interested in your thoughts on this.





More information about the Digitalmars-d mailing list