Re: Is package.d a good idea?

2018-07-04 Thread Jonathan M Davis via Digitalmars-d
On Wednesday, July 04, 2018 11:50:07 Steven Schveighoffer via Digitalmars-d wrote: > The obvious pros to ditching package.d and using a directory and module > with the same name are: 1. no ambiguity in the filesystem (assuming you > don't have weird package/file schemes) and 2. It's more

Re: Is package.d a good idea?

2018-07-04 Thread Steven Schveighoffer via Digitalmars-d
On 7/4/18 11:29 AM, Jonathan M Davis wrote: On Wednesday, July 04, 2018 11:13:07 Steven Schveighoffer via Digitalmars-d wrote: I think if we went the different route we would have to provide a mechanism to declare inside the module "this is a package". Maybe "package module"? I would point

Re: Is package.d a good idea?

2018-07-04 Thread Jonathan M Davis via Digitalmars-d
On Wednesday, July 04, 2018 11:13:07 Steven Schveighoffer via Digitalmars-d wrote: > I think if we went the different route we would have to provide a > mechanism to declare inside the module "this is a package". Maybe > "package module"? I would point out that the pretty much the only reason

Re: Is package.d a good idea?

2018-07-04 Thread Steven Schveighoffer via Digitalmars-d
is a good idea, and if we should try to get rid of it as well. How would this affect the package attribute? Currently, anything inside the package.d file that is attributed with package is limited to the package itself, not where the package resides. Likewise, anything attributed with package

Re: Is package.d a good idea?

2018-07-04 Thread Steven Schveighoffer via Digitalmars-d
On 7/4/18 10:59 AM, Adam D. Ruppe wrote: On Wednesday, 4 July 2018 at 14:54:41 UTC, Steven Schveighoffer wrote: How would this affect the package attribute? Nothing should change, since packages are determined from the D module declaration, not the filename or directory layout. This is

Re: Is package.d a good idea?

2018-07-04 Thread aliak via Digitalmars-d
, it has to be 'foo/mod.rs'. Now in the Rust 2018 edition, they are getting rid of mod.rs. So when you import 'foo', rustc will always look for 'foo.rs', and if 'foo' has submodules, it can still reside in 'foo/submodule.rs'. This makes me think if package.d is a good idea, and if we should

Re: Is package.d a good idea?

2018-07-04 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 4 July 2018 at 14:54:41 UTC, Steven Schveighoffer wrote: How would this affect the package attribute? Nothing should change, since packages are determined from the D module declaration, not the filename or directory layout. This is even true with package.d itself, but it is a

Re: Is package.d a good idea?

2018-07-04 Thread Steven Schveighoffer via Digitalmars-d
, they are getting rid of mod.rs. So when you import 'foo', rustc will always look for 'foo.rs', and if 'foo' has submodules, it can still reside in 'foo/submodule.rs'. This makes me think if package.d is a good idea, and if we should try to get rid of it as well. How would this affect the package attribute

Re: Is package.d a good idea?

2018-07-04 Thread WebFreak001 via Digitalmars-d
edition, they are getting rid of mod.rs. So when you import 'foo', rustc will always look for 'foo.rs', and if 'foo' has submodules, it can still reside in 'foo/submodule.rs'. This makes me think if package.d is a good idea, and if we should try to get rid of it as well. when I started D I

Re: Is package.d a good idea?

2018-07-03 Thread aliak via Digitalmars-d
On Tuesday, 3 July 2018 at 12:51:59 UTC, bauss wrote: On Tuesday, 3 July 2018 at 12:51:18 UTC, bauss wrote: On Sunday, 1 July 2018 at 11:36:51 UTC, Yuxuan Shui wrote: [...] I use package.d for more than just submodules. I use it to share modules from different packages into a single

Re: Is package.d a good idea?

2018-07-03 Thread bauss via Digitalmars-d
-modules, it has to be 'foo/mod.rs'. Now in the Rust 2018 edition, they are getting rid of mod.rs. So when you import 'foo', rustc will always look for 'foo.rs', and if 'foo' has submodules, it can still reside in 'foo/submodule.rs'. This makes me think if package.d is a good idea, and if we

Re: Is package.d a good idea?

2018-07-03 Thread bauss via Digitalmars-d
edition, they are getting rid of mod.rs. So when you import 'foo', rustc will always look for 'foo.rs', and if 'foo' has submodules, it can still reside in 'foo/submodule.rs'. This makes me think if package.d is a good idea, and if we should try to get rid of it as well. I use package.d

Re: Is package.d a good idea?

2018-07-03 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 07/01/2018 10:23 AM, Yuxuan Shui wrote: I was suggesting we do what Rust did. i.e. 'import foo', imports foo.d, which can in turn do 'import foo.bar', which will import foo/bar.d. AIUI, D doesn't support having *both* a module (ie, file 'foo.d') and a package (ie, directory 'foo/') with

Re: Is package.d a good idea?

2018-07-01 Thread Jonathan M Davis via Digitalmars-d
On Sunday, July 01, 2018 14:23:36 Yuxuan Shui via Digitalmars-d wrote: > On Sunday, 1 July 2018 at 11:55:17 UTC, Jonathan M Davis wrote: > > On Sunday, July 01, 2018 11:36:51 Yuxuan Shui via Digitalmars-d > > > > wrote: > >> [...] > > > > The entire reason that package.d was added as a feature was

Re: Is package.d a good idea?

2018-07-01 Thread 12345swordy via Digitalmars-d
On Sunday, 1 July 2018 at 21:40:05 UTC, Yuxuan Shui wrote: On Sunday, 1 July 2018 at 18:03:41 UTC, Adam D. Ruppe wrote: On Sunday, 1 July 2018 at 14:23:36 UTC, Yuxuan Shui wrote: I was suggesting we do what Rust did. i.e. 'import foo', imports foo.d, which can in turn do 'import foo.bar',

Re: Is package.d a good idea?

2018-07-01 Thread Yuxuan Shui via Digitalmars-d
On Sunday, 1 July 2018 at 18:03:41 UTC, Adam D. Ruppe wrote: On Sunday, 1 July 2018 at 14:23:36 UTC, Yuxuan Shui wrote: I was suggesting we do what Rust did. i.e. 'import foo', imports foo.d, which can in turn do 'import foo.bar', which will import foo/bar.d. Yeah, that's the way it should

Re: Is package.d a good idea?

2018-07-01 Thread Basile B. via Digitalmars-d
On Sunday, 1 July 2018 at 14:23:36 UTC, Yuxuan Shui wrote: On Sunday, 1 July 2018 at 11:55:17 UTC, Jonathan M Davis wrote: On Sunday, July 01, 2018 11:36:51 Yuxuan Shui via Digitalmars-d wrote: [...] The entire reason that package.d was added as a feature was so that modules could be split

Re: Is package.d a good idea?

2018-07-01 Thread Adam D. Ruppe via Digitalmars-d
On Sunday, 1 July 2018 at 14:23:36 UTC, Yuxuan Shui wrote: I was suggesting we do what Rust did. i.e. 'import foo', imports foo.d, which can in turn do 'import foo.bar', which will import foo/bar.d. Yeah, that's the way it should have been done in the first place. Nowhere else in D does it

Re: Is package.d a good idea?

2018-07-01 Thread Yuxuan Shui via Digitalmars-d
On Sunday, 1 July 2018 at 11:55:17 UTC, Jonathan M Davis wrote: On Sunday, July 01, 2018 11:36:51 Yuxuan Shui via Digitalmars-d wrote: [...] The entire reason that package.d was added as a feature was so that modules could be split into packages without breaking code, and it's still

Re: Is package.d a good idea?

2018-07-01 Thread Jonathan M Davis via Digitalmars-d
rs'. > > Now in the Rust 2018 edition, they are getting rid of mod.rs. So > when you import 'foo', rustc will always look for 'foo.rs', and > if 'foo' has submodules, it can still reside in > 'foo/submodule.rs'. > > This makes me think if package.d is a good idea, and if we shou

Re: Is package.d a good idea?

2018-07-01 Thread rikki cattermole via Digitalmars-d
, they are getting rid of mod.rs. So when you import 'foo', rustc will always look for 'foo.rs', and if 'foo' has submodules, it can still reside in 'foo/submodule.rs'. This makes me think if package.d is a good idea, and if we should try to get rid of it as well. We added it a few years ago after 10

Is package.d a good idea?

2018-07-01 Thread Yuxuan Shui via Digitalmars-d
'foo', rustc will always look for 'foo.rs', and if 'foo' has submodules, it can still reside in 'foo/submodule.rs'. This makes me think if package.d is a good idea, and if we should try to get rid of it as well.