v3: scope of definitions in included files

Let the developers know what you think of the software and what can be done to either improve the CFDG language or the Context Free program.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
User avatar
kipling
Posts: 91
Joined: Wed Jun 18, 2008 2:36 am

v3: scope of definitions in included files

Post 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?

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: v3: scope of definitions in included files

Post 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.

User avatar
kipling
Posts: 91
Joined: Wed Jun 18, 2008 2:36 am

Re: v3: scope of definitions in included files

Post by kipling »

OK thanks - this makes sense to me.

Post Reply