Does Kernel.match?/2 get special treatment?

39 views
Skip to first unread message

Brian Cardarella

unread,
Jun 6, 2024, 6:35:12 PMJun 6
to elixir-lang-core
I'm trying to produce something similar to `Kernel.match?/2` in that I can pass a pattern to it, but if I reproduce the same macro I get the "cannot be an expression" error.

I have a livebook here with output showing:


I searched the source but cannot seem to find any special tokenization case for that match?/2 as to why it is treated differently.

José Valim

unread,
Jun 6, 2024, 6:47:21 PMJun 6
to elixir-l...@googlegroups.com
Remember to require it before using it.

There is an issue to improve the error message in this cases.

--
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 elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/208e5c50-061c-4d4d-a426-d86756903e27n%40googlegroups.com.

Brian Cardarella

unread,
Jun 6, 2024, 6:59:58 PMJun 6
to elixir-lang-core
yes, thank you
Reply all
Reply to author
Forward
0 new messages