3 ms·
Well Scala does that () thing too. On the other hand, an infinite loop in Scala would run much more quickly than in Ruby.
by cosmo7 17y ago
Well Scala does that () thing too. On the other hand, an infinite loop in Scala would run much more quickly than in Ruby.
- jorgeortiz85 17y agoIn Scala, defining a method and a variable with the same name would be a compile-time error.
- carbon8 17y agoA situation like the OP's would run in an infinite loop even in Scala. There's no compile-time error in Scala when you have a method call itself, which is what the OP is describing, and his variable also wasn't named the same as the method: "@name" vs "name".