when is an operator - it behaves very similar to operators like == or in.
iex(1)> quote(do: 1 when 2)
{:when, [], [1, 2]}
iex(2)> quote(do: 1 == 2)
{:==, [context: Elixir, import: Kernel], [1, 2]}
In case of def, the left side (of the operator) is the call and right the
guards.
Michał.
On 9
If I quote the following:
Code.string_to_quoted """
if foo do
"true"
else
"false"
end
"""
I get the following AST:
{:if, [line: 1], [{:foo, [line: 1], nil}, [do: "true", else: "false"]]}
Which makes sense to me as the last node is a list. However, `when` seems
to follow