Thread overview
Would like an example of using the "package" attr
Jun 22, 2004
David L. Davis
Re: Would like an example of package
Jun 22, 2004
Arcane Jill
Jun 22, 2004
David L. Davis
June 22, 2004
I've been looking around wiki and here, but I can't seem to find an example of how to use the new "package" attribute that's in the current "D" v0.92 build. Could someone please explain how and when it's used, and maybe even write some "D" code to show it in use. It would be very helpful.

Thxs in advance! ;)

-------------------------------------------------------------------
"Dare to reach for the Stars...Dare to Dream, Build, and Achieve!"
June 22, 2004
In article <cb8424$5q9$1@digitaldaemon.com>, David L. Davis says...
>
>I've been looking around wiki and here, but I can't seem to find an example of how to use the new "package" attribute that's in the current "D" v0.92 build. Could someone please explain how and when it's used, and maybe even write some "D" code to show it in use. It would be very helpful.

--- In file1 ----

>    package int f()
>    {
>        // body
>    }

--- In file2 ---

>    import file1;
>
>    int n = f();

The "package" constraint means that f() is not callable unless file1 and file2 are in the same dirctory.

Arcane Jill


June 22, 2004
In article <cb95n0$1oem$1@digitaldaemon.com>, Arcane Jill says...
>
>In article <cb8424$5q9$1@digitaldaemon.com>, David L. Davis says...
>>
>>I've been looking around wiki and here, but I can't seem to find an example of how to use the new "package" attribute that's in the current "D" v0.92 build. Could someone please explain how and when it's used, and maybe even write some "D" code to show it in use. It would be very helpful.
>
>--- In file1 ----
>
>>    package int f()
>>    {
>>        // body
>>    }
>
>--- In file2 ---
>
>>    import file1;
>>
>>    int n = f();
>
>The "package" constraint means that f() is not callable unless file1 and file2 are in the same dirctory.
>
>Arcane Jill
>
>

Arcane Jill: Thxs! :)

-------------------------------------------------------------------
"Dare to reach for the Stars...Dare to Dream, Build, and Achieve!"