version and extern problems

nonnymouse nonnymouse at nonnymouse.hole
Wed Jul 11 02:23:39 PDT 2007


0ffh Wrote:

> Nope. This, for example, is a perfectly valid D program:
[snip]
Then it must be "foo is not defined on line 1". ;-)

I think maybe you thought I said line 1 last time. I said line 2. I was assuming that the compiler had looked ahead and come to a dead-end (or more expressively: a cul-de-sac).
(We are assuming that is either the whole program or the only lines that matter here are we?)

At some point, even if it is just before code generation all these symbols need to be defined. The compiler must choose a, possibly arbitrary,  order in which it fills them. Surely when going through the AST to do this for a particular symbol, if it meets itself further down the tree it throws an error.

I chose a sarcastically vague one.. "Symbol x cannot de defined as definition of x is based on definition of x" might make a bit more sense.

Please, if possible, read this as a question rather than an answer. i.e I would genuinely like to be corrected where I have misunderstood (or missed out) some of the complexities of these issues. 



More information about the Digitalmars-d mailing list