4 ms·
I'm looking forward to `def` returning a symbol (page 11). private static void def main(args) ...; end
by taylorfausak 13y ago
I'm looking forward to `def` returning a symbol (page 11).
private static void def main(args) ...; end
- ngcazz 13y agoThat 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)?
- lectrick 13y agoIf 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.
- hderms 13y agoyeah it's an example of how you could implement higher-level language features much easier if def returns a symbol rather than nil