On 21/09/14 22:04, Walter Bright wrote:

Lookup rules are straightforward:

   scope is current scope
   do {
       look up name in scope
       if name is found, done!
       look up name in imports imported into scope
       if name is found, done!
       set scope to enclosing scope
    } while scope exists

I don't know what mental model people have for how lookups work, but the
above algorithm is how it actually works.

You better write down the scope rules as well. It gets complicated with base classes, template mixins and all features available in D.

--
/Jacob Carlborg

Reply via email to