I’ve read in more than one place that a tuple of size 1 or 2 is quoted
“as itself”… Did this change?
I don’t find it to be the case for a 1-element tuple, unless I am doing
something dumb…
Also mildly curious why if size 2 and/or one is special, size 0 is not…
defmodule Macros do
defmacro showme(expr) do
IO.inspect expr
end
end
require Macros
Macros.showme 555 # 555
Macros.showme {} # {:{}, [line: 4], []}
Macros.showme {1} # {:{}, [line: 5], [1]} <-- ??
Macros.showme {1,2} # {1, 2}
Macros.showme {1,2,3} # {:{}, [line: 7], [1, 2, 3]}
Thanks,
Hal