thautwarm / MLStyle.jl

Julia functional programming infrastructures and metaprogramming facilities
https://thautwarm.github.io/MLStyle.jl/latest/
MIT License
402 stars 38 forks source link

`@match :(if true; end) :(if true; end) => 1` fails #188

Closed jariji closed 6 months ago

jariji commented 7 months ago

This fails to match. Is this expected?

@match :(if true; end) :(if true; end) => 1
thautwarm commented 6 months ago

This is because line numbers are automatically inserted into your quotations:

@match :(if true; end) :(if true; $(lines...) end) => lines

1-element view(::Vector{Any}, 1:1) with eltype Any:
 :(#= REPL[4]:1 =#)

MLStyle uses a strict match so that we can distinguish the cases that involve subtle differences.