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: chris, MtnViewMark, MtnViewJohn

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 » Sun Jun 19, 2011 4:32 pm

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: 844
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: v3: scope of definitions in included files

Post by MtnViewJohn » Sun Jun 19, 2011 4:51 pm

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 » Mon Jun 20, 2011 7:10 pm

OK thanks - this makes sense to me.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests