Subject: Re: Difference between return and "not return"
From: Steve Klabnik <steve steveklabnik.com>
Date: Fri, 10 Feb 2012 02:45:19 +0900
References: 393319
In-reply-to: 393319
Because 'return' takes an argument, and ruby infers the []s.
In the second case, 1, 2 by itself is not a valid statement, it
doesn't guess the []s.
Just do
def y
[1, 2]
end