Thread overview | ||||||
---|---|---|---|---|---|---|
|
March 19, 2003 Another question about imports | ||||
---|---|---|---|---|
| ||||
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? |
March 19, 2003 Re: Another question about imports | ||||
---|---|---|---|---|
| ||||
Posted in reply to Deja Augustine | 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.
|
March 19, 2003 Re: Another question about imports | ||||
---|---|---|---|---|
| ||||
Posted in reply to Burton Radons | 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? |
March 19, 2003 Re: Another question about imports | ||||
---|---|---|---|---|
| ||||
Posted in reply to Deja Augustine | 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.
|
Copyright © 1999-2021 by the D Language Foundation