DEV Community

Discussion on: Any thoughts on Ruby 2.6?

Collapse
 
rhymes profile image
rhymes

Yes to union, the new merge reminds me of Object.assign in JS, not psyched about the breaking change and this feature here seems unnecessary and confusing:

double = proc { |x| x * 2 }
increment = proc { |x| x + 1 }
(double >> increment).call(2) #=> 5
(double << increment).call(2) #=> 6

Did we really need an operator to invert the order of composition of anonymous functions? 🧐

Why not simply invert the functions?

(double >> increment).call(2) #=> 5
(increment >> double).call(2) #=> 6

The thing I find more interesting is not mentioned in the article, the preview JIT compiler. It's not enabled by default but it could speed up long lived processes like web apps. It's described on ruby-lang.org -> Ruby 2.6.0-rc2 Released