RE: Multiple includes (was: Rob's going to hate me... (Remainder bug))

new topic     » goto parent     » topic index » view thread      » older message » newer message

On 11 Nov 2003 at 16:58, Al Getz wrote:

> 
> 
> Matt Lewis wrote:
> > 
> > 
> > Irv Mullins wrote:
> > 
> > > This has nothing to do with what those namespaces are called in 
> > > other files,  There's no reason you should have to edit other files 
> > > or third party source.  You know this is true, because namespaces 
> > > are never passed on. 
> > 
> > This is exactly my point.  How could another file refer to a specific 
> > instance of a file?
> > 
> > Matt Lewis
> > 
> 
> As it stands, the 'new include' technique would refer to a 
> *local* instance only.  This means the included file acts
> as a local resource similar to the way local variables work.
> This should make it pretty easy to implement too.
> 
> As noted before:
> 
> --rect.ew
> atom x1,y1,x2,y2
> x1=0
> y1=0
> x2=0
> y2=0
> 
> 
> --file.exw
> include new rect.ew as r1
> include new rect.ew as r2
> r1:x1=10
> r1:y1=10
> r2:x1=20
> r2:y1=20
> 
> 
> Here, each rect refers to a different set of x and y variables
> even though only one include file was needed.  In other words,
> we were able to use two different objects (rects in this case)
> of the same type that needed to be described only once in
> rect.ew .  This is also a powerful technique, considering the
> original file can be extremely complex in itself but used
> more then once for more then one object by simply declaring
> it a second or more times taking up only one more line of code.
> 
> Take care,
> Al

Is this not just a subset of what even simple objects supply?

--rect.ew
class Rect 
atom x1,y1,x2,y2
x1=0
y1=0
x2=0
y2=0
end class


--file.exw
include rect.exw
Rect r1, r2
r1.x1=10
r1.y1=10
r2.x1=20
r2.y1=20

Karl Bochert

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu