On Tue, Jan 31, 2012 at 08:57, Garthy D
<garthy_lmkltybr / entropicsoftware.com> wrote:

> On 31/01/12 17:16, Gavin Sinclair wrote:

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

> I can understand why the language rejects that construct (I've never tried
> it myself- an interesting find!). The method itself would be returning an
> array (correct?), and an array would always be treated as true in the
> expression, regardless of the results. Thus, it is likely to be some sortf
> error (why put an always-statically-true expression in a conditional?), and
> hence knocks it back with an error.

if true
  puts 'well that a relief'
end

> I'm wondering as to the best behaviour if it were actually handled directly
> by the language (which I'm not specifically suggesting). True if any of the
> multiple assignments evaluate to true? Or just the first? Or last? Certainly
> not always-true. I can't say I'd know a sensible default. :/

[a, b, .any?