News for hackers. Stuff that matters.
Re:Ruby 2.1.0 preview1 released by riffraff on Monday September 23, 2013 @02:26AM (#6429427)
I think def's return value means returning symbol rather than nil? I've been waiting for it for ten years, I had almost forgotten why I wanted it in the first place :)
Re:Ruby 2.1.0 preview1 released by _anshulk on Monday September 23, 2013 @02:41AM (#6429453)
So, this would mean that

private def foo

end

will now work?

Re:Ruby 2.1.0 preview1 released by invisiblefunnel on Monday September 23, 2013 @02:56AM (#6429475)
Re:Ruby 2.1.0 preview1 released by transfire on Monday September 23, 2013 @05:29AM (#6429781)
Yes. And it is somewhat surprising. Matz must have rejected this idea a dozen times. It was certainly one of the oldest feature requests around. Hard to imagine what must have changed his mind. I've rarely seem Matz change his mind.
Re:Ruby 2.1.0 preview1 released by riffraff on Monday September 23, 2013 @05:09PM (#6434186)
I seem to recall the issue was more with returning UnboundMethod objects than with symbols, but possibly what's changed is the fact that now symbols can be GCed?
Re:Ruby 2.1.0 preview1 released by charlysisto on Monday September 23, 2013 @08:17AM (#6430304)
Please tell us, what's the use case ?
Re:Ruby 2.1.0 preview1 released by amccloud on Monday September 23, 2013 @01:54PM (#6432802)
Re:Ruby 2.1.0 preview1 released by transfire on Monday September 23, 2013 @12:06PM (#6431899)
It would allow you to do a number things. For instance: `memo def foo` to transform a method into a memoized version.