I don't think that package works

Thomas Kuehne thomas-dloop at kuehne.cn
Fri Mar 24 06:28:38 PST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jarrett Billingsley schrieb am 2006-03-23:
> Please tell me what I'm doing wrong here.
>
> -----------------
> /dtest/dtest.d
> -----------------
>
> module dtest;
>
> import modules.mymod;
>
> void main()
> {
>  f();
>  g();
>  h();
> }
>
> -----------------
> /dtest/modules/mymod.d
> -----------------
>
> module modules.mymod;
>
> public void f()
> {
>
> }
>
> private void g()
> {
>
> }
>
> package void h()
> {
>
> }
>
>
> DMD correctly flags my trying to call g() as an error.  But it doesn't flag 
> h().  Shouldn't only other files in /dtest/modules/ be able to access h()? 

Your interpretation is correct.
http://dstress.kuehne.cn/nocompile/package_01.d
(and http://dstress.kuehne.cn/addon/package_01_A.d)

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFEJAPa3w+/yD4P9tIRAq5QAKCkQ+DITKSfEOL4PJBu+0Nw+WaukgCfceY/
NZVspTtu633FQx1kSc11ICk=
=Jauj
-----END PGP SIGNATURE-----



More information about the Digitalmars-d mailing list