My understanding is that the if
statements at the end of the line are evaluated before the code at the front of the line:
\'never shown\' if (fa
My guess is that the order of parsing is different from the (logical) order of execution. In particular, given
array << error if (error = some_function)
Then logically, execution should go something like
some_function
error
not defined, define error
some_function
to error
if
if
evaluates to true
, append value of error
to array
However, parsing wise (assuming typical LR parser), it goes
array
(identifier). Is this defined? Yes. Is it a variable? Yes.<<
(operator). Does array
respond to <<
? Yes (otherwise, output "undefined method" error).error
(identifier). Is this defined? No. Output "undefined local variable or method".