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 understan

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 out

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 tha

Re: Is package.d a good idea?

2018-07-04 Thread Steven Schveighoffer via Digitalmars-d
On 7/4/18 11:06 AM, aliak wrote: On Wednesday, 4 July 2018 at 14:54:41 UTC, Steven Schveighoffer wrote: On 7/1/18 7:36 AM, Yuxuan Shui wrote: In Rust, they have something call mod.rs, which is very similar to package.d. When you use a module 'foo' in Rust, it can either be 'foo.rs' or 'foo/mod

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 even

Re: Is package.d a good idea?

2018-07-04 Thread aliak via Digitalmars-d
On Wednesday, 4 July 2018 at 14:54:41 UTC, Steven Schveighoffer wrote: On 7/1/18 7:36 AM, Yuxuan Shui wrote: In Rust, they have something call mod.rs, which is very similar to package.d. When you use a module 'foo' in Rust, it can either be 'foo.rs' or 'foo/mod.rs'. If 'foo' has sub-modules, i

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 w

Re: Is package.d a good idea?

2018-07-04 Thread Steven Schveighoffer via Digitalmars-d
On 7/1/18 7:36 AM, Yuxuan Shui wrote: In Rust, they have something call mod.rs, which is very similar to package.d. When you use a module 'foo' in Rust, it can either be 'foo.rs' or 'foo/mod.rs'. If 'foo' has sub-modules, it has to be 'foo/mod.rs'. Now in the Rust 2018 edition, they are getti

Re: Is package.d a good idea?

2018-07-04 Thread WebFreak001 via Digitalmars-d
On Sunday, 1 July 2018 at 11:36:51 UTC, Yuxuan Shui wrote: In Rust, they have something call mod.rs, which is very similar to package.d. When you use a module 'foo' in Rust, it can either be 'foo.rs' or 'foo/mod.rs'. If 'foo' has sub-modules, it has to be 'foo/mod.rs'. Now in the Rust 2018 ed

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 package

Re: Is package.d a good idea?

2018-07-03 Thread bauss via Digitalmars-d
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: In Rust, they have something call mod.rs, which is very similar to package.d. When you use a module 'foo' in Rust, it can either be 'foo.rs' or 'foo/mod.rs'. If 'foo' has sub-module

Re: Is package.d a good idea?

2018-07-03 Thread bauss via Digitalmars-d
On Sunday, 1 July 2018 at 11:36:51 UTC, Yuxuan Shui wrote: In Rust, they have something call mod.rs, which is very similar to package.d. When you use a module 'foo' in Rust, it can either be 'foo.rs' or 'foo/mod.rs'. If 'foo' has sub-modules, it has to be 'foo/mod.rs'. Now in the Rust 2018 ed

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 t

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', which

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 ha

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 i

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

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 valuable

Re: Is package.d a good idea?

2018-07-01 Thread Jonathan M Davis via Digitalmars-d
On Sunday, July 01, 2018 11:36:51 Yuxuan Shui via Digitalmars-d wrote: > In Rust, they have something call mod.rs, which is very similar > to package.d. When you use a module 'foo' in Rust, it can either > be 'foo.rs' or 'foo/mod.rs'. If 'foo' has sub-modules, it has to > be 'foo/mod.rs'. > > Now i

Re: Is package.d a good idea?

2018-07-01 Thread rikki cattermole via Digitalmars-d
On 01/07/2018 11:36 PM, Yuxuan Shui wrote: In Rust, they have something call mod.rs, which is very similar to package.d. When you use a module 'foo' in Rust, it can either be 'foo.rs' or 'foo/mod.rs'. If 'foo' has sub-modules, it has to be 'foo/mod.rs'. Now in the Rust 2018 edition, they are

Is package.d a good idea?

2018-07-01 Thread Yuxuan Shui via Digitalmars-d
In Rust, they have something call mod.rs, which is very similar to package.d. When you use a module 'foo' in Rust, it can either be 'foo.rs' or 'foo/mod.rs'. If 'foo' has sub-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 '