www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Would like an example of using the "package" attr

reply David L. Davis <SpottedTiger yahoo.com> writes:
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!"
Jun 21 2004
parent reply Arcane Jill <Arcane_member pathlink.com> writes:
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
Jun 22 2004
parent David L. Davis <SpottedTiger yahoo.com> writes:
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!"
Jun 22 2004