POV-Ray : Newsgroups : povray.general : POV-Ray Includes - Standards : Re: POV-Ray Includes - Standards Server Time
1 Aug 2024 00:21:42 EDT (-0400)
  Re: POV-Ray Includes - Standards  
From: Randall Sawyer
Date: 5 Dec 2006 19:55:00
Message: <web.4576146147def5cae81faf070@news.povray.org>
"Randall Sawyer" <sra### [at] yahoocom> wrote:
> I hope I've shed some light on my line of thought.  BTW: I started reading
> the source code last night.

I would like to continue to clarify the naming model I am suggesting with
some vocabulary.  This is my own vocabulary.  If my idea has already been
implemented in some other application, and there is a pre-existing
vocabulary, then I would like to know that.



I am now thinking of files (include and renderable files both) in terms of
"spaces."

"Declaration Space":
The set of declares and macros defined in an include file.

"Implementation Space":
The set of code snippits which make use of any and all declares and/or
macros from a given include file.  (Note:  A file which calls more than one
include will have the same number of "implementation spaces".)


I am thinking of the set of named macros and declares - defined in an
include file - and those same macros and declares - implemented in a file
which calls that include file - in terms of a "membrane."

"Namespace Membrane":
A virtual structure implied by a single line in a file beginning with the
directive "#include ".  On one side of the 'Namespace Membrane' is the
'Declaration Space' of the called include file.  On the other side of the
same membrane is the 'Implementation Space' of the file containing the
'#include directive'.



I am thinking of the set of files (one renderable file, its includes, those
includes' includes, and so on) in terms of a tree - along the lines of a
'directory tree'.  At the bottom is the renderable file - the single trunk
of the tree.  Includes called by the renderable file are 'lower' and
includes called by other includes are 'upper' (as in branches).

"Upper Namespace Membrane":
Each include file has an 'Implementation Space' for each include file it
calls - thus implying the same number of 'namespace membranes'.  (This
number may be zero (0) or positive.)  Lets call each of these an "Upper
Namespace Membrane".

"Lower Namespace Membrane":
Every include file has exactly one "Lower Namespace Membrane".  It is
implied each time the include file is '#include'd by another file.

[Note:  The same include file may be called more than once in the same tree.
 However, after being altered by the parser to avoid naming collisions, it
will have been transformed into a number of unique manifestations.]



An important rule to note:
In the model I propose, names are prevented from migrating from an 'upper
namespace membrane' to a 'lower namespace membrane' by virtue of the
parser's treatment of the file tree.  Therefore, if your renderable file
'#include's "A.inc" - and - file "A.inc" '#include's "B.inc", then you
would not be able to access the 'declaration space' of "B.inc" unless your
file also includes "B.inc".


I hope this glorious mish-mash of metaphors is somewhat helpful in
communicating my vision.  Next, I think I'll tinker with a C++ mock-up.
But, please stop me from just spinning my wheels if it turns out that's all
that I'm doing.


Thanks,
Randall


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.