Re:What's New in Ruby 2.1 [pdf]
by taylorfausak on Wednesday November 27, 2013 @11:12AM
(#6808881)
I'm looking forward to `def` returning a symbol (page 11).
[ Parent
| on HN ]
That slide was a bit confusing for my underslept mind. Is that meant as an example of calling methods which work over the result of defining main (in this case static and void)?
If you say "private def methodname(args); end",
the "private" keyword already takes a symbol for a method name to privatize, so in this case the return of "def methodname(args); end" is ":methodname" which then gets passed to "private" and everything magically works.