Hipreme's #4 Tip of the day - Don't use package.d

2022-11-04 Thread Hipreme via Digitalmars-d-learn
Package.d is a real problem existing on our currently modules design. First is that it means to take the directory name to use as a module. This is a problem for 3 reasons: 1. You won't be able to find your module by the file name. This is incredibly common, for instance, in Visual Studio Cod

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-04 Thread bauss via Digitalmars-d-learn
On Friday, 4 November 2022 at 10:57:12 UTC, Hipreme wrote: ... I disagree completely with being against package.d. Having used D for like a decade at this point, I've never experienced any issues with it. Most issues seems to be for newcomers and people who aren't entirely familiar with ho

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-04 Thread Adam D Ruppe via Digitalmars-d-learn
On Friday, 4 November 2022 at 14:11:55 UTC, bauss wrote: Having used D for like a decade at this point, I've never experienced any issues with it. Lucky you, lots of other people have. Broken phobos updates, impossible to transition to it without code breakages (which is the only reason it ex

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-04 Thread Hipreme via Digitalmars-d-learn
On Friday, 4 November 2022 at 14:11:55 UTC, bauss wrote: On Friday, 4 November 2022 at 10:57:12 UTC, Hipreme wrote: ... I disagree completely with being against package.d. Having used D for like a decade at this point, I've never experienced any issues with it. Most issues seems to be for

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-04 Thread z via Digitalmars-d-learn
On Friday, 4 November 2022 at 10:57:12 UTC, Hipreme wrote: ... What do we use instead? I won't lie about the fact package.d forced me to workaround elusive "bugs" in my usage(1) but what is the alternative if we don't want to work around it? (1)(ime : had cases of package.d requiring compil

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-04 Thread Hipreme via Digitalmars-d-learn
On Friday, 4 November 2022 at 16:21:17 UTC, z wrote: On Friday, 4 November 2022 at 10:57:12 UTC, Hipreme wrote: ... What do we use instead? I won't lie about the fact package.d forced me to workaround elusive "bugs" in my usage(1) but what is the alternative if we don't want to work around i

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-04 Thread jmh530 via Digitalmars-d-learn
On Friday, 4 November 2022 at 16:56:59 UTC, Hipreme wrote: [snip] You can use any name instead. The only difference between an ordinary source file and a package.d is the module name. For instance, if you're inside the filesystem directory, you can change the name to literally anything and im

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-04 Thread Adam D Ruppe via Digitalmars-d-learn
On Friday, 4 November 2022 at 19:10:33 UTC, jmh530 wrote: If you don't plan to use private(package_name), then I don't know what the point of it is. This works fine without the package.d anyway.

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-04 Thread jmh530 via Digitalmars-d-learn
On Friday, 4 November 2022 at 19:17:04 UTC, Adam D Ruppe wrote: On Friday, 4 November 2022 at 19:10:33 UTC, jmh530 wrote: If you don't plan to use private(package_name), then I don't know what the point of it is. This works fine without the package.d anyway. Oh really, then what's the point

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-04 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Nov 04, 2022 at 07:34:58PM +, jmh530 via Digitalmars-d-learn wrote: > On Friday, 4 November 2022 at 19:17:04 UTC, Adam D Ruppe wrote: > > On Friday, 4 November 2022 at 19:10:33 UTC, jmh530 wrote: > > > If you don't plan to use private(package_name), then I don't know > > > what the poin

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-04 Thread Adam D Ruppe via Digitalmars-d-learn
On Friday, 4 November 2022 at 19:34:58 UTC, jmh530 wrote: Oh really, then what's the point of package.d? It was originally added because Phobos had `std.algorithm` and `std.datetime` and some people wanted to break them up into pieces, but not break user code that still said `import std.algo

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-04 Thread Adam D Ruppe via Digitalmars-d-learn
On Friday, 4 November 2022 at 19:40:09 UTC, H. S. Teoh wrote: So that you can import abc.def separately from abc.def.ghi and abc.def.jkl. This isn't that hard; in the old days you'd have `pkg.foo` then `import pkg.all` instead of `import pkg;`. The specific thing that led to the package.d thi

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-04 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/4/22 3:49 PM, Adam D Ruppe wrote: On Friday, 4 November 2022 at 19:34:58 UTC, jmh530 wrote: Oh really, then what's the point of package.d? It was originally added because Phobos had `std.algorithm` and `std.datetime` and some people wanted to break them up into pieces, but not break us

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-04 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 4 November 2022 at 19:53:01 UTC, Adam D Ruppe wrote: This isn't that hard; in the old days you'd have `pkg.foo` then `import pkg.all` instead of `import pkg;`. It was worse, you would do import mylib.all; and now it's just: import mylib; Also the "all" concept is bad, it s

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-04 Thread ryuukk_ via Digitalmars-d-learn
On Friday, 4 November 2022 at 10:57:12 UTC, Hipreme wrote: Package.d is a real problem existing on our currently modules design. First is that it means to take the directory name to use as a module. This is a problem for 3 reasons: 1. You won't be able to find your module by the file name. Th

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-05 Thread Hipreme via Digitalmars-d-learn
On Saturday, 5 November 2022 at 01:34:04 UTC, ryuukk_ wrote: On Friday, 4 November 2022 at 10:57:12 UTC, Hipreme wrote: Package.d is a real problem existing on our currently modules design. First is that it means to take the directory name to use as a module. This is a problem for 3 reasons:

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-05 Thread ryuukk_ via Digitalmars-d-learn
On Saturday, 5 November 2022 at 10:18:33 UTC, Hipreme wrote: On Saturday, 5 November 2022 at 01:34:04 UTC, ryuukk_ wrote: On Friday, 4 November 2022 at 10:57:12 UTC, Hipreme wrote: Package.d is a real problem existing on our currently modules design. First is that it means to take the directory

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-05 Thread Salih Dincer via Digitalmars-d-learn
On Friday, 4 November 2022 at 10:57:12 UTC, Hipreme wrote: Package.d is a real problem existing on our currently modules design. First is that it means to take the directory name to use as a module. If the example mentioned in this thread is not confusing, package.d is a godsend. 😉 https://

Re: Hipreme's #4 Tip of the day - Don't use package.d

2022-11-05 Thread Dennis via Digitalmars-d-learn
On Friday, 4 November 2022 at 10:57:12 UTC, Hipreme wrote: 3. I'm currently having a bug on my API module that every duplicated file name, even when located at different directories(modules), are generating duplicate symbol. The major problem is that this is currently undebuggable, as the MSVC