3 ms·
While I'm not sure Scala is the Language of the Future™, it's relevant to this discussion to point out that the method_missing hacks that make ruby's dynamic ty
by KirinDave 16y ago
While I'm not sure Scala is the Language of the Future™, it's relevant to this discussion to point out that the method_missing hacks that make ruby's dynamic typing so attractive are being actively prototyped in Scala.
An example snippet: https://gist.github.com/783394 https://gist.github.com/783394
The implementation: http://lampsvn.epfl.ch/trac/scala/changeset/23993 http://lampsvn.epfl.ch/trac/scala/changeset/23993
- bguthrie 16y agoFor what it's worth, and a bit OT, I find method_missing to be the least appealing part of Ruby's runtime dynamism. What _is_ helpful is to be able to add methods on the fly (e.g., through define_method); on the other hand, being able to handle arbitrary messages (which is what method_missing does) is occasionally interesting (as with Rails' dynamic finders) but generally considered bad form given that there are clearer and more performant alternatives.
- KirinDave 16y agoI only mention the method_missing because most modern languages have fairly good answers to the "safely extend a type" problem, without succumbing to the problems that languages like Ruby suffer.