I find this a strange Ruby error.

foo = [1,2]

# The following is fine.
if (a = foo)
  puts a
end

# The following causes a SyntaxError: multiple assignment in conditional.
if (a, b = foo)
  puts a
end


Why would that be a syntax error?  Surely the grammar is

  if EXPR
    ...

and (a, b = foo) is an expression, isn't it?

Just curious, though my curiosity was prompted by a failing piece of real
code.

Gavin