| According to Matz last year, "The version number goes up to 2.0 but the changes are rather small. Smaller than the ones we made in 1.9." http://www.rubyinside.com/ruby-2-0-implementation-work-begin... Here's a Quora thread with links to a presentation by Matz and a summary by Yehuda Katz:
http://www.quora.com/Ruby-programming-language/What-are-the-... "Language improvements: - Named arguments.. 1.step(by: 2, to: 10) { ... } - Selector namespaces (unclear to me whether this differs from refinements as described by Katz) - Multiple inheritance Interpreter Improvements: - Incremental performance improvements over 1.9's VM - Better compatibility with non-unix environments and small/constrained devices (embeddable) - Sandboxed VM's (VM per thread)" Matz's presentation:
http://www.youtube.com/watch?feature=player_embedded&v=t... Yehuda's summary of "refinements":
http://yehudakatz.com/2010/11/30/ruby-2-0-refinements-in-pra... |
yes, though it's basically an optional argument hash. AFAIK, you can't do required named arguments without weird hacks, or specifically checking the arguments. For example:
This hack makes the "bar" parameter required, but only because the value is evaluated when the method is called, and you get a NameError (rather than an ArgumentError).> Selector namepaces
yes, but it's called refinements. You can see how they're used here: https://github.com/ruby/ruby/blob/trunk/test/ruby/test_refin... (sorry for the link to a test, I'm feeling lazy ;-) )
> Multiple inheritance
Sorry, there won't be multiple inheritance.
> Incremental performance improvements over 1.9's VM
yes, ko1 has been working on removing / optimizing bytecodes in the VM.
> Better compatibility with non-unix environments and small/constrained devices (embeddable)
I don't know of any work on this other than mruby, which isn't MRI.
> Sandboxed VM's (VM per thread)
nope. https://bugs.ruby-lang.org/issues/7003
Other stuff:
* DTrace probes
* Better within ruby tracing https://bugs.ruby-lang.org/issues/6895
I run edge ruby against rails daily. The main incompatibilities I've hit in Ruby 2.0 are what methods respond_to? searches (I've blogged about that here: http://tenderlovemaking.com/2012/09/07/protected-methods-and... ), and the `Config` constant has been removed (which is sometimes an issue for C extensions).
EDIT
Just thought of this for the required args:
You could probably define a private method like `required` or some such, like this: