I would prefer to not change the semantics of the code, because it can lead
to subtle behavior: for example, what if the match is inside one of the
monad libraries that already override what = means?

You can say we could detect those cases, but it is not trivial to
differentiate from a macro that transform = from another one that wouldn’t
(such as the if/2) macro.

In other words, macros that traverse ASTs and change the semantics of the
code should not be encouraged, so I don’t think we should go ahead with
this.

On Wed, Nov 3, 2021 at 13:25 Artur Plysyuk <[email protected]> wrote:

> Hi,
>
> Current behavour:
>
> []  = all_enqueued(queue: :default)
> #  raises *** (MatchError)*
>
> assert []  = all_enqueued(queue: :default)
> # formatted as *match (=) failed*
>
> Actually, the proposal is to kinda implicitly add assert to expressions
> which have match operator, so in case of errors output is automatically
> formatted like the expression is written with assert.
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/133cd523-bdbf-4544-a524-671219707aean%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/133cd523-bdbf-4544-a524-671219707aean%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4JsVfbYe0P%3DTgS%3DULT_YKB1OBHq99DEeW%2BLbZg%3Dk_3RkA%40mail.gmail.com.

Reply via email to