Re: Namespace for a module defined by its import path

2016-11-09 Thread Jeff Thompson via Digitalmars-d
On Wednesday, 9 November 2016 at 22:15:31 UTC, Jeff Thompson wrote: On Wednesday, 9 November 2016 at 07:21:28 UTC, ZombineDev wrote: On Tuesday, 8 November 2016 at 18:33:13 UTC, Jeff Thompson wrote: On Tuesday, 8 November 2016 at 17:00:44 UTC, Jeff Thompson wrote: [...] ... or is there a way

Re: Namespace for a module defined by its import path

2016-11-09 Thread Jeff Thompson via Digitalmars-d
On Wednesday, 9 November 2016 at 07:21:28 UTC, ZombineDev wrote: On Tuesday, 8 November 2016 at 18:33:13 UTC, Jeff Thompson wrote: On Tuesday, 8 November 2016 at 17:00:44 UTC, Jeff Thompson wrote: On Wednesday, 26 October 2016 at 17:12:30 UTC, Jonathan Marler wrote: [...] Right now, if a mod

Re: Namespace for a module defined by its import path

2016-11-08 Thread ZombineDev via Digitalmars-d
On Tuesday, 8 November 2016 at 18:33:13 UTC, Jeff Thompson wrote: On Tuesday, 8 November 2016 at 17:00:44 UTC, Jeff Thompson wrote: On Wednesday, 26 October 2016 at 17:12:30 UTC, Jonathan Marler wrote: On Wednesday, 26 October 2016 at 09:53:35 UTC, Jeff Thompson wrote: [...] I've thought abo

Re: Namespace for a module defined by its import path

2016-11-08 Thread Jeff Thompson via Digitalmars-d
On Tuesday, 8 November 2016 at 17:00:44 UTC, Jeff Thompson wrote: On Wednesday, 26 October 2016 at 17:12:30 UTC, Jonathan Marler wrote: On Wednesday, 26 October 2016 at 09:53:35 UTC, Jeff Thompson wrote: [...] I've thought about this and have concluded that you can't replicate these semantic

Re: Namespace for a module defined by its import path

2016-11-08 Thread Jeff Thompson via Digitalmars-d
On Wednesday, 26 October 2016 at 17:12:30 UTC, Jonathan Marler wrote: On Wednesday, 26 October 2016 at 09:53:35 UTC, Jeff Thompson wrote: [...] I've thought about this and have concluded that you can't replicate these semantics in D. Here's 2 solutions though: [...] Right now, if a modul

Re: Namespace for a module defined by its import path

2016-10-26 Thread Jonathan Marler via Digitalmars-d
On Wednesday, 26 October 2016 at 09:53:35 UTC, Jeff Thompson wrote: On Wednesday, 26 October 2016 at 07:57:57 UTC, Mike Parker wrote: On Wednesday, 26 October 2016 at 07:14:30 UTC, Jeff Thompson wrote: dmd -I/commit_b3bf5c7725c98ee3e49dfc4e47318162f138fe94/version/ main.d dmd -I//commit_d

Re: Namespace for a module defined by its import path

2016-10-26 Thread Mike Parker via Digitalmars-d
On Wednesday, 26 October 2016 at 09:53:35 UTC, Jeff Thompson wrote: var Utils1 = require('commit_b3bf5c7/utils.js').Utils; var Utils2 = require('commit_df0741a/utils.js').Utils; That works because require operates in terms of files, not modules. In D, module and package names may have a def

Re: Namespace for a module defined by its import path

2016-10-26 Thread Dicebot via Digitalmars-d
On 10/24/2016 11:06 PM, Jeff Thompson wrote: > ... If I really had to do something like that and there was no other way, I'd most likely resort to auto-generating such module names during build pipeline. signature.asc Description: OpenPGP digital signature

Re: Namespace for a module defined by its import path

2016-10-26 Thread Jeff Thompson via Digitalmars-d
On Wednesday, 26 October 2016 at 07:57:57 UTC, Mike Parker wrote: On Wednesday, 26 October 2016 at 07:14:30 UTC, Jeff Thompson wrote: dmd -I/commit_b3bf5c7725c98ee3e49dfc4e47318162f138fe94/version/ main.d dmd -I//commit_df0741a84c8a967ea08674090afdff4e9a58d23e/version/ main.d This will

Re: Namespace for a module defined by its import path

2016-10-26 Thread deadalnix via Digitalmars-d
On Wednesday, 26 October 2016 at 07:14:30 UTC, Jeff Thompson wrote: This will force the application to use either one version or the other. As I said, it's a large application. I different parts of the same application to be able to import the version they need. Unless there are some part of

Re: Namespace for a module defined by its import path

2016-10-26 Thread Mike Parker via Digitalmars-d
On Wednesday, 26 October 2016 at 07:14:30 UTC, Jeff Thompson wrote: dmd -I/commit_b3bf5c7725c98ee3e49dfc4e47318162f138fe94/version/ main.d dmd -I//commit_df0741a84c8a967ea08674090afdff4e9a58d23e/version/ main.d This will force the application to use either one version or the other. As I

Re: Namespace for a module defined by its import path

2016-10-26 Thread Jeff Thompson via Digitalmars-d
On Wednesday, 26 October 2016 at 01:15:02 UTC, Mike Parker wrote: On Tuesday, 25 October 2016 at 22:25:51 UTC, Jeff Thompson wrote: On Tuesday, 25 October 2016 at 19:54:42 UTC, Jonathan Marler wrote: On Tuesday, 25 October 2016 at 06:47:14 UTC, Jeff Thompson wrote: [...] Sorry if I didn't un

Re: Namespace for a module defined by its import path

2016-10-25 Thread Mike Parker via Digitalmars-d
On Tuesday, 25 October 2016 at 22:25:51 UTC, Jeff Thompson wrote: On Tuesday, 25 October 2016 at 19:54:42 UTC, Jonathan Marler wrote: On Tuesday, 25 October 2016 at 06:47:14 UTC, Jeff Thompson wrote: [...] Sorry if I didn't understand something, couldn't you do this? /commit_b3bf5c7725c98ee3

Re: Namespace for a module defined by its import path

2016-10-25 Thread Jeff Thompson via Digitalmars-d
On Tuesday, 25 October 2016 at 19:54:42 UTC, Jonathan Marler wrote: On Tuesday, 25 October 2016 at 06:47:14 UTC, Jeff Thompson wrote: [...] Sorry if I didn't understand something, couldn't you do this? /commit_b3bf5c7725c98ee3e49dfc4e47318162f138fe94/version/lib.d /commit_df0741a84c8a967ea086

Re: Namespace for a module defined by its import path

2016-10-25 Thread Jonathan Marler via Digitalmars-d
On Tuesday, 25 October 2016 at 06:47:14 UTC, Jeff Thompson wrote: On Tuesday, 25 October 2016 at 00:42:59 UTC, Adam D. Ruppe wrote: [...] A variant of this is where the version name is the Git commit hash. Instead of "version1" and "version2" it is: /commit_b3bf5c7725c98ee3e49dfc4e47318162f

Re: Namespace for a module defined by its import path

2016-10-24 Thread Jeff Thompson via Digitalmars-d
On Tuesday, 25 October 2016 at 00:42:59 UTC, Adam D. Ruppe wrote: On Monday, 24 October 2016 at 21:06:18 UTC, Jeff Thompson wrote: Basically, I want the namespace of the identifiers in the library module to be defined by the path which is use to load them *without needing to put the path in the

Re: Namespace for a module defined by its import path

2016-10-24 Thread Adam D. Ruppe via Digitalmars-d
On Monday, 24 October 2016 at 21:06:18 UTC, Jeff Thompson wrote: Basically, I want the namespace of the identifiers in the library module to be defined by the path which is use to load them *without needing to put the path in the module file.* Is there some way to do this? That's not going t

Re: Namespace for a module defined by its import path

2016-10-24 Thread Adam D. Ruppe via Digitalmars-d
On Monday, 24 October 2016 at 23:26:09 UTC, bitwise wrote: Not sure if I understand you correctly, but you're allowed to omit the module declaration, if that helps: It doesn't help, I strongly recommend you ALWAYS use the explicit module definition. If you leave it out, you'll regret it sooner

Re: Namespace for a module defined by its import path

2016-10-24 Thread bitwise via Digitalmars-d
On Monday, 24 October 2016 at 21:06:18 UTC, Jeff Thompson wrote: I have different versions of a library module in different folders. For example /version1/lib.d /version2/lib.d In my application I need to be able to update the names of the different folders without needing to change the modul

Namespace for a module defined by its import path

2016-10-24 Thread Jeff Thompson via Digitalmars-d
I have different versions of a library module in different folders. For example /version1/lib.d /version2/lib.d In my application I need to be able to update the names of the different folders without needing to change the module files. That means the file cannot contain "module version1.lib;