slepher / astranaut

traverse erlang ast and elixir macro in erlang.
MIT License
15 stars 0 forks source link

case clause match pattern works like elixir #8

Closed slepher closed 4 years ago

slepher commented 4 years ago

elixir-lang#case-cond-and-if

If you want to pattern match against an existing variable, you need to use the ^ operator:

iex> x = 1 1 iex> case 10 do ...> ^x -> "Won't match" ...> _ -> "Will match" ...> end "Will match"