Page 1 of 1

v3: scope of definitions in included files

Posted: Sun Jun 19, 2011 4:32 pm
by kipling
Just reading through the v3 spec, I noticed this:
Global definitions inside included files have scope in the including file.
Does this mean that such definitions are unavailable outside the file, or only available via a namespace?

Re: v3: scope of definitions in included files

Posted: Sun Jun 19, 2011 4:51 pm
by MtnViewJohn
Hah! I just changed that. Global definitions inside include files are available outside of the file. Global definitions all have global scope, not file scope. If the include file has a namespace then you access it through the namespace. Otherwise you can access it directly.

I also changed the namespace implementation to be more like what you originally suggested. A generalized namespace capability is overkill for Context Free. Instead, a namespace can be specified when you include a file.

Re: v3: scope of definitions in included files

Posted: Mon Jun 20, 2011 7:10 pm
by kipling
OK thanks - this makes sense to me.