At last, enough commit activity on HEAD to justify an update to my
summary of changes in Ruby 1.9. It looked as if almost
nothing had happened in the last three months (Akira's work on the
non-blocking IO stuff and little more) and then came matz's gigantic patch
with a load of Ruby2 features...
Syntax
Those who don't understand the meaning of the word "experimental" and
foreboded Ruby's demise in the arcane syntax pit and, well, pretty much any
Rubyist out there ;), will be happy to know that the ;; terminator and the
->(){} lambda notation are dead!
Some new syntax arrived to take the place of these syntactical failures, but it
blends quite nicely with 1.8's.
As suggested by Audrey Tang, you can use
several splat operators in a method call:
String#[] now returns a one-char-wide String instead of a Fixnum; String#[]=,
IO#getc and the ?c syntax were changed accordingly. The new String#ord allows
you to get your friendly Fixnum out of the String returned by String#[], so
'a'[0].ord
is equivalent 'a'[0] in 1.8.
Misc. new methods
A bunch of non-blocking methods in IO, Socket, TCPServer and UNIXServer,
Proc#yield, __method__ and __callee__, Math#log2...