Re: Understanding the Use of Nested Import and Selective Import in D

2024-01-17 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, January 17, 2024 7:03:18 AM MST Renato via Digitalmars-d-learn wrote: > My main reasoning is that D tools, surprisingly, cannot do > "Optimize Imports" (turns out that with all the metaprogramming > going on , it's impossible to tell for sure which imports are > being used - or so I

Re: Understanding the Use of Nested Import and Selective Import in D

2024-01-17 Thread Renato via Digitalmars-d-learn
On Wednesday, 17 January 2024 at 13:38:10 UTC, Orfeo wrote: On Tuesday, 16 January 2024 at 19:05:43 UTC, Jonathan M Davis wrote: When local imports were introduced, they were pushed as best practice (in part, because Andrei is a big fan of them), and I think that for the most part, they

Re: Understanding the Use of Nested Import and Selective Import in D

2024-01-17 Thread Orfeo via Digitalmars-d-learn
On Tuesday, 16 January 2024 at 19:05:43 UTC, Jonathan M Davis wrote: When local imports were introduced, they were pushed as best practice (in part, because Andrei is a big fan of them), and I think that for the most part, they still are, but there's definitely going to be some disagreement

Re: Understanding the Use of Nested Import and Selective Import in D

2024-01-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, January 16, 2024 1:42:04 PM MST bomat via Digitalmars-d-learn wrote: > Wow, that was... exhaustive. Thanks for that. :) > One more question that I have, though... > > On Tuesday, 16 January 2024 at 19:05:43 UTC, Jonathan M Davis > > wrote: > > The downside of course is that you then

Re: Understanding the Use of Nested Import and Selective Import in D

2024-01-16 Thread bomat via Digitalmars-d-learn
Wow, that was... exhaustive. Thanks for that. :) One more question that I have, though... On Tuesday, 16 January 2024 at 19:05:43 UTC, Jonathan M Davis wrote: The downside of course is that you then have import statements throughout your code, and they're often going to be duplicated

Re: Understanding the Use of Nested Import and Selective Import in D

2024-01-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, January 16, 2024 6:19:59 AM MST Orfeo via Digitalmars-d-learn wrote: > I found myself a bit perplexed when it comes to the usage of > "nested imports" and selective imports. It seems that prominent D > programmers have varied opinions on the matter. I would love to > hear your

Re: Understanding the Use of Nested Import and Selective Import in D

2024-01-16 Thread Orfeo via Digitalmars-d-learn
On Tuesday, 16 January 2024 at 13:19:59 UTC, Orfeo wrote: I found myself a bit perplexed when it comes to the usage of "nested imports" and selective imports. It seems that prominent D programmers have varied opinions on the matter. I would love to hear your insights and experiences on this

Re: Understanding the Use of Nested Import and Selective Import in D

2024-01-16 Thread user1234 via Digitalmars-d-learn
On Tuesday, 16 January 2024 at 13:37:59 UTC, user1234 wrote: Implementation detail. D frontend resolves identifiers using associative arrays (that's called symtabs in the compiler IIRC), hence the only complexity is the scope (plus the import decls found while going back to the module scope).

Re: Understanding the Use of Nested Import and Selective Import in D

2024-01-16 Thread user1234 via Digitalmars-d-learn
On Tuesday, 16 January 2024 at 13:19:59 UTC, Orfeo wrote: I found myself a bit perplexed when it comes to the usage of "nested imports" and selective imports. It seems that prominent D programmers have varied opinions on the matter. I would love to hear your insights and experiences on this

Re: Understanding the Use of Nested Import and Selective Import in D

2024-01-16 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
Yes, I try to place my imports at the most general location that makes sense. Sometimes that is at the module level, other times its in a single function. Or anywhere in between (such as a struct).

Understanding the Use of Nested Import and Selective Import in D

2024-01-16 Thread Orfeo via Digitalmars-d-learn
I found myself a bit perplexed when it comes to the usage of "nested imports" and selective imports. It seems that prominent D programmers have varied opinions on the matter. I would love to hear your insights and experiences on this topic. Here's a quick summary of what I've come across from