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
> 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 <
> 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
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
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
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
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