digitalmars.dip.ideas - Grouped named import
- ryuukk_ (8/8) Jul 22 Saw this somewhere, and to be honest, that's something i always
- Quirin Schroll (9/17) Jul 22 Is it equivalent to this?
- Quirin Schroll (8/29) Jul 22 I just realized one can do this:
- ryuukk_ (3/10) Jul 22 I didn't know it was possible, that's good to know, no need for
- ryuukk_ (4/15) Jul 22 I just tested, it doesn't work...
- Quirin Schroll (4/20) Jul 23 It doesn’t work for module-scope imports, as you point out, but
- ryuukk_ (6/8) Jul 22 Invalid argument, goal is conciseness
- ryuukk_ (11/32) Jul 22 No, i specifically wrote grouped, there might be a better word
- ryuukk_ (4/25) Jul 22 In retrospect, you clearly do not understand both the feature,
- ryuukk_ (1/1) Jul 22 @moderator, please delete this thread, it is spam
- Dennis (13/14) Jul 22 I deleted some posts here and a duplicate thread.
- ryuukk_ (3/17) Jul 23 I asked for you to remove my thread, so can you please remove my
- Quirin Schroll (13/21) Jul 23 Now that I understand what you mean, I suggest the following
Saw this somewhere, and to be honest, that's something i always wanted to be able to do That may be something i could try to implement, sounds relatively easy ```D import c = sqlite3, miniz; ``` https://dlang.org/spec/module.html#renamed_imports
Jul 22
On Monday, 22 July 2024 at 11:23:51 UTC, ryuukk_ wrote:Saw this somewhere, and to be honest, that's something i always wanted to be able to do That may be something i could try to implement, sounds relatively easy ```D import c = sqlite3, miniz; ``` https://dlang.org/spec/module.html#renamed_importsIs it equivalent to this? ```d import c = sqlite3; import miniz; ``` If yes, this requires no DIP. But honestly, the reason why D requires separate import statements for renaming stuff is that it’s much clearer.
Jul 22
On Monday, 22 July 2024 at 12:06:52 UTC, Quirin Schroll wrote:On Monday, 22 July 2024 at 11:23:51 UTC, ryuukk_ wrote:I just realized one can do this: ```d import x = std.stdio; import x = std.file; ``` If that is intended, it’s especially important for clarity that separate import statements are required.Saw this somewhere, and to be honest, that's something i always wanted to be able to do That may be something i could try to implement, sounds relatively easy ```D import c = sqlite3, miniz; ``` https://dlang.org/spec/module.html#renamed_importsIs it equivalent to this? ```d import c = sqlite3; import miniz; ``` If yes, this requires no DIP. But honestly, the reason why D requires separate import statements for renaming stuff is that it’s much clearer.
Jul 22
On Monday, 22 July 2024 at 12:29:24 UTC, Quirin Schroll wrote:I just realized one can do this: ```d import x = std.stdio; import x = std.file; ``` If that is intended, it’s especially important for clarity that separate import statements are required.I didn't know it was possible, that's good to know, no need for that DIP then, case is closed, thanks!
Jul 22
On Monday, 22 July 2024 at 12:47:34 UTC, ryuukk_ wrote:On Monday, 22 July 2024 at 12:29:24 UTC, Quirin Schroll wrote:I just tested, it doesn't work... `onlineapp.d(2): Error: import `onlineapp.x` conflicts with import `onlineapp.x` at onlineapp.d(1)`I just realized one can do this: ```d import x = std.stdio; import x = std.file; ``` If that is intended, it’s especially important for clarity that separate import statements are required.I didn't know it was possible, that's good to know, no need for that DIP then, case is closed, thanks!
Jul 22
On Monday, 22 July 2024 at 12:49:29 UTC, ryuukk_ wrote:On Monday, 22 July 2024 at 12:47:34 UTC, ryuukk_ wrote:It doesn’t work for module-scope imports, as you point out, but it’s not diagnosed for function-scope imports. [Filed a bug.](https://issues.dlang.org/show_bug.cgi?id=24672)On Monday, 22 July 2024 at 12:29:24 UTC, Quirin Schroll wrote:I just tested, it doesn't work... `onlineapp.d(2): Error: import `onlineapp.x` conflicts with import `onlineapp.x` at onlineapp.d(1)`I just realized one can do this: ```d import x = std.stdio; import x = std.file; ``` If that is intended, it’s especially important for clarity that separate import statements are required.I didn't know it was possible, that's good to know, no need for that DIP then, case is closed, thanks!
Jul 23
On Monday, 22 July 2024 at 12:29:24 UTC, Quirin Schroll wrote:If that is intended, it’s especially important for clarity that separate import statements are required.Invalid argument, goal is conciseness Your example is confusing because of duplication Mine is simple and clear, i suggest you read about other languages who successfully adopted similar feature Zig and Typescript for example
Jul 22
On Monday, 22 July 2024 at 12:06:52 UTC, Quirin Schroll wrote:On Monday, 22 July 2024 at 11:23:51 UTC, ryuukk_ wrote:No, i specifically wrote grouped, there might be a better word for it It means, symbols from `sqlite3` and `miniz` are isolated into the `c` name Example: ```D c.sqlite3_init(); c.miniz_init(); ``` This is useful for ImportCSaw this somewhere, and to be honest, that's something i always wanted to be able to do That may be something i could try to implement, sounds relatively easy ```D import c = sqlite3, miniz; ``` https://dlang.org/spec/module.html#renamed_importsIs it equivalent to this? ```d import c = sqlite3; import miniz; ``` If yes, this requires no DIP. But honestly, the reason why D requires separate import statements for renaming stuff is that it’s much clearer.
Jul 22
On Monday, 22 July 2024 at 12:06:52 UTC, Quirin Schroll wrote:On Monday, 22 July 2024 at 11:23:51 UTC, ryuukk_ wrote:In retrospect, you clearly do not understand both the feature, the suggestion and the point of the feature This is sadSaw this somewhere, and to be honest, that's something i always wanted to be able to do That may be something i could try to implement, sounds relatively easy ```D import c = sqlite3, miniz; ``` https://dlang.org/spec/module.html#renamed_importsIs it equivalent to this? ```d import c = sqlite3; import miniz; ``` If yes, this requires no DIP. But honestly, the reason why D requires separate import statements for renaming stuff is that it’s much clearer.
Jul 22
On Monday, 22 July 2024 at 11:23:51 UTC, ryuukk_ wrote:...I deleted some posts here and a duplicate thread. ryuukk_ When your DIP Idea is not understood, please clarify it in the same thread. It's the DIP author's responsibility to convey their idea to others. Do not take it out on the person giving feedback, and do not try to replace the thread with a new one. I understand you don't want to the thread to be cluttered with initial misunderstandings, but this forum is not like git where you can easily amend and rebase if you mess up. If you want to avoid this situation, elaborate more in your initial DIP idea post with complete examples and explanations. Let's keep this thread about the DIP idea itself now, thanks!
Jul 22
On Monday, 22 July 2024 at 15:27:35 UTC, Dennis wrote:On Monday, 22 July 2024 at 11:23:51 UTC, ryuukk_ wrote:I asked for you to remove my thread, so can you please remove my thread? thanks...I deleted some posts here and a duplicate thread. ryuukk_ When your DIP Idea is not understood, please clarify it in the same thread. It's the DIP author's responsibility to convey their idea to others. Do not take it out on the person giving feedback, and do not try to replace the thread with a new one. I understand you don't want to the thread to be cluttered with initial misunderstandings, but this forum is not like git where you can easily amend and rebase if you mess up. If you want to avoid this situation, elaborate more in your initial DIP idea post with complete examples and explanations. Let's keep this thread about the DIP idea itself now, thanks!
Jul 23
On Tuesday, 23 July 2024 at 10:14:18 UTC, ryuukk_ wrote:I asked for you to remove my thread, so can you please remove my thread? thanksWe delete posts when they contain personal insults (both explicit and underhanded) or when they are off-topic to the point of derailing the thread. We can delete a post by special request from the author, but in the case of this thread, Quirin made replies perfectly following the DIP forum guidelines, which we won't delete without a good reason. What I can do is informally close the thread: From here on out, subsequent replies to this thread will be deleted.
Jul 23
On Tuesday, 23 July 2024 at 11:11:42 UTC, Dennis wrote:On Tuesday, 23 July 2024 at 10:14:18 UTC, ryuukk_ wrote:Brother, i ask you again to remove my content from your website, why is it hard for you to understand that i want my messages to be removed Have you heard of GDPR?I asked for you to remove my thread, so can you please remove my thread? thanksWe delete posts when they contain personal insults (both explicit and underhanded) or when they are off-topic to the point of derailing the thread. We can delete a post by special request from the author, but in the case of this thread, Quirin made replies perfectly following the DIP forum guidelines, which we won't delete without a good reason. What I can do is informally close the thread: From here on out, subsequent replies to this thread will be deleted.What I can do is informally close the thread:No, what you will do is remove this thread, again, i ask you to please remove my thread
Jul 23
On Monday, 22 July 2024 at 11:23:51 UTC, ryuukk_ wrote:Saw this somewhere, and to be honest, that's something i always wanted to be able to do That may be something i could try to implement, sounds relatively easy ```D import c = sqlite3, miniz; ``` https://dlang.org/spec/module.html#renamed_importsNow that I understand what you mean, I suggest the following syntax: ```d import c { sqlite3, miniz } ``` Essentially, you propose an `import` construct that creates a namespace. If you want a suggestion for the DIP name: _Import Namespaces_ Honestly, I like this. It’s essentially equivalent to creating a module named `c` and `public import`ing all the symbols listed in the braces. (Maybe this doesn’t require a DIP, I don’t know.)
Jul 23