Thread overview
modules have to be imported by themselves
Feb 12, 2005
Thomas Kühne
Feb 13, 2005
Regan Heath
Feb 13, 2005
Thomas Kühne
Feb 13, 2005
Regan Heath
Feb 13, 2005
Thomas Kühne
February 12, 2005
in order to access module members with fully qualified identifiers the
modules are current required to import themselves.

doesn't compile:
# module a.b;
#
# int i;
#
# void test(){
#     int j = a.b.i;
# }

test case:
http://dstress.kuehne.cn/run/module_01.d

Thomas
February 13, 2005
On Sat, 12 Feb 2005 00:04:46 +0100, Thomas Kühne <thomas-dloop@kuehne.THISISSPAM.cn> wrote:
> in order to access module members with fully qualified identifiers the
> modules are current required to import themselves.
>
> doesn't compile:
> # module a.b;
> #
> # int i;
> #
> # void test(){
> #     int j = a.b.i;
> # }
>
> test case:
> http://dstress.kuehne.cn/run/module_01.d

I assume you know you can just use ".i"?
My question is, why do you want 2 ways to achieve the same thing? Is one different in some way, i.e. you can't use ".i" for some reason?

Regan
February 13, 2005
Regan Heath wrote:
| On Sat, 12 Feb 2005 00:04:46 +0100, Thomas Kühne
| <thomas-dloop@kuehne.THISISSPAM.cn> wrote:
|
|> in order to access module members with fully qualified identifiers
|> the modules are currently required to import themselves.
|>
|> doesn't compile:
|> # module a.b;
|> #
|> # int i;
|> #
|> # void test(){
|> #     int j = a.b.i;
|> # }
|>
|> test case:
|> http://dstress.kuehne.cn/run/module_01.d
|
|
| I assume you know you can just use ".i"?
| My question is, why do you want 2 ways to achieve the same thing? Is
| one  different in some way, i.e. you can't use ".i" for some reason?

This is only a symptom of a mall-functioning name resolution.

Modules do known their namespace(package+module name), don't they?

file: tmp/a.d
#
# module tmp.b;
#
# int i;
#
# void test(){
#	int m = b.i; // XPASS
#	int n = tmp.b.i; // FAIL
#	int o = a.i; // XFAIL
#	int p = tmp.a.i; // XFAIL
# }
#

It seems that only the module name is honored, not the package name.

Thomas
February 13, 2005
On Sun, 13 Feb 2005 23:12:46 +0100, Thomas Kühne <thomas-dloop@kuehne.THISISSPAM.cn> wrote:
> Regan Heath wrote:
> | On Sat, 12 Feb 2005 00:04:46 +0100, Thomas Kühne
> | <thomas-dloop@kuehne.THISISSPAM.cn> wrote:
> |
> |> in order to access module members with fully qualified identifiers
> |> the modules are currently required to import themselves.
> |>
> |> doesn't compile:
> |> # module a.b;
> |> #
> |> # int i;
> |> #
> |> # void test(){
> |> #     int j = a.b.i;
> |> # }
> |>
> |> test case:
> |> http://dstress.kuehne.cn/run/module_01.d
> |
> |
> | I assume you know you can just use ".i"?
> | My question is, why do you want 2 ways to achieve the same thing? Is
> | one  different in some way, i.e. you can't use ".i" for some reason?
>
> This is only a symptom of a mall-functioning name resolution.

Sure, I agree. But, my question is what is the point of having two methods to do the same thing?

> Modules do known their namespace(package+module name), don't they?

Apparently not.


> file: tmp/a.d
> #
> # module tmp.b;
> #
> # int i;
> #
> # void test(){
> #	int m = b.i; // XPASS
> #	int n = tmp.b.i; // FAIL
> #	int o = a.i; // XFAIL
> #	int p = tmp.a.i; // XFAIL
> # }
> #
>
> It seems that only the module name is honored, not the package name.

I still don't understand xpass, fail, xfail etc. What does the 'x' mean?

Regan
February 13, 2005
Regan Heath wrote:

| On Sun, 13 Feb 2005 23:12:46 +0100, Thomas Kühne
| <thomas-dloop@kuehne.THISISSPAM.cn> wrote:
|
|> Regan Heath wrote:
|> | On Sat, 12 Feb 2005 00:04:46 +0100, Thomas Kühne
|> | <thomas-dloop@kuehne.THISISSPAM.cn> wrote:
|> |
|> |> in order to access module members with fully qualified identifiers
|> |> the modules are currently required to import themselves.
|> |>
|> |> doesn't compile:
|> |> # module a.b;
|> |> #
|> |> # int i;
|> |> #
|> |> # void test(){
|> |> #     int j = a.b.i;
|> |> # }
|> |>
|> |> test case:
|> |> http://dstress.kuehne.cn/run/module_01.d
|> |
|> |
|> | I assume you know you can just use ".i"?
|> | My question is, why do you want 2 ways to achieve the same thing? Is
|> | one  different in some way, i.e. you can't use ".i" for some reason?
|>
|> This is only a symptom of a mall-functioning name resolution.
|
| Sure, I agree. But, my question is what is the point of having two
| methods  to do the same thing?

Using the full quallifier is very usefull if portions of the code are
likely to be copied/moved into other modules in the near future.

|> Modules do known their namespace(package+module name), don't they?
|
| Apparently not.
|
|> file: tmp/a.d
|> #
|> # module tmp.b;
|> #
|> # int i;
|> #
|> # void test(){
|> #    int m = b.i; // XPASS
|> #    int n = tmp.b.i; // FAIL
|> #    int o = a.i; // XFAIL
|> #    int p = tmp.a.i; // XFAIL
|> # }
|> #
|>
|> It seems that only the module name is honored, not the package name.
|
| I still don't understand xpass, fail, xfail etc. What does the 'x' mean?

pass	test case was expected to pass, and it did
xpass	test case was expected to fail, but passed
fail	test case was expected to pass, but failed
xfail	test case was expected to fail, and it did

Thomas