www.digitalmars.com         C & C++   DMDScript  

D - Another question about imports

reply Deja Augustine <Deja_member pathlink.com> writes:
I was curious if imported files were transparent, as in if A imports B and C
imports A, can C access B through A?   hm... that looks confusing, let me
qualify it with some pseudocode:

B:  int y;
A:  import B; int x;
C:  import A; A.B.y = 3;  A.x = 4;

Will that work or is it necessary for C to import B directly to access y?
Mar 19 2003
parent reply Burton Radons <loth users.sourceforge.net> writes:
Deja Augustine wrote:
 I was curious if imported files were transparent, as in if A imports B and C
 imports A, can C access B through A?   hm... that looks confusing, let me
 qualify it with some pseudocode:
 
 B:  int y;
 A:  import B; int x;
 C:  import A; A.B.y = 3;  A.x = 4;
 
 Will that work or is it necessary for C to import B directly to access y?
Yes.
Mar 19 2003
parent reply Deja Augustine <Deja_member pathlink.com> writes:
In article <b5aaqo$300s$1 digitaldaemon.com>, Burton Radons says...
Deja Augustine wrote:
 I was curious if imported files were transparent, as in if A imports B and C
 imports A, can C access B through A?   hm... that looks confusing, let me
 qualify it with some pseudocode:
 
 B:  int y;
 A:  import B; int x;
 C:  import A; A.B.y = 3;  A.x = 4;
 
 Will that work or is it necessary for C to import B directly to access y?
Yes.
yes it will work, or yes it is necessary?
Mar 19 2003
parent Burton Radons <loth users.sourceforge.net> writes:
Deja Augustine wrote:
 In article <b5aaqo$300s$1 digitaldaemon.com>, Burton Radons says...
 
Deja Augustine wrote:

I was curious if imported files were transparent, as in if A imports B and C
imports A, can C access B through A?   hm... that looks confusing, let me
qualify it with some pseudocode:

B:  int y;
A:  import B; int x;
C:  import A; A.B.y = 3;  A.x = 4;

Will that work or is it necessary for C to import B directly to access y?
Yes.
yes it will work, or yes it is necessary?
Yes. ... It'll work, imports are imported.
Mar 19 2003