Wondering how match? does what it does, does anyone know of an explanation, or can anyone walk me through the code?
https://github.com/elixir-lang/elixir/blob/master/lib/elixir/lib/kernel.ex#L2293
Thanks!
Wondering how match? does what it does, does anyone know of an explanation, or can anyone walk me through the code?
https://github.com/elixir-lang/elixir/blob/master/lib/elixir/lib/kernel.ex#L2293
Thanks!
Basically it just converts this:
result = match?(a, b)
Into this:
result =
case b do
a ->
true
_ ->
false
end
So it just tests if the left argument matches the right argument via a case expression, and if it does it returns true, if it does not then it returns false. ![]()
Thanks, OvermindDL1.
Got it.