Re: [elixir-core:10931] Re: Proposal: add :guards option to import/2

2022-06-13 Thread Kenny Evitt
I don't know the details about practical means of distinguishing between guards and regular macros – sorry! (I also didn't realize when I wrote my previous reply that you were the same person that created this post – sorry for that too! I've been bouncing around a bunch of different things so

Re: [elixir-core:10929] Re: Proposal: add :guards option to import/2

2022-06-13 Thread José Valim
> How would you make the distinction between a guard and a regular macro? This is exactly the root issue for me. :( I am not sure if we should rule out macros, just because they are not written with defguard. On Mon, Jun 13, 2022 at 21:42 'eksperimental' via elixir-lang-core <

Re: [elixir-core:10928] Re: Proposal: add :guards option to import/2

2022-06-13 Thread 'eksperimental' via elixir-lang-core
> Would you think it would make sense to _exclude_ any 'guard macros' > either NOT defined with `defguard` nor having whatever relevant > attribute there might be? How would you make the distinction between a guard and a regular macro? > I'm trying to think how useful this > request/proposal

Re: [elixir-core:10928] Re: Proposal: add :guards option to import/2

2022-06-13 Thread Kenny Evitt
Those are good details to know – thanks! And thanks for pointing out my 'brain fart' about `defguardp`. Would you think it would make sense to _exclude_ any 'guard macros' either NOT defined with `defguard` nor having whatever relevant attribute there might be? I'm trying to think how useful

Re: [elixir-core:10926] Re: Proposal: add :guards option to import/2

2022-06-13 Thread 'eksperimental' via elixir-lang-core
As of now, when you define a guard with `defguard` it adds the attribute: `@doc guard: true`, we could include guards that are defined with `defguard` and any other macros with this attribute set. Or we could introduce a new attribute for identifying guards, as @doc seems limited to documentation

[elixir-core:10926] Re: Proposal: add :guards option to import/2

2022-06-13 Thread Kenny Evitt
So the `:guards` option would only import guard macros? Should this option also import guards that are NOT defined using `defguard` or `defguardp`? On Monday, June 13, 2022 at 10:02:46 AM UTC-4 eksperimental wrote: > Hi, > Currenly import/1 allows us to import :functions, :macros, :sigils with

[elixir-core:10924] Proposal: add :guards option to import/2

2022-06-13 Thread 'eksperimental' via elixir-lang-core
Hi, Currenly import/1 allows us to import :functions, :macros, :sigils with the :only option. I have found myself to manually have to list every guard I want to import from my "Util" module. This has been a recurring issue. I think it will be a good addition given the nature of guards that since