I had wondered why most recent Ruby releases were on Christmas Day and recently found out why. The Ruby creator Matz is religious (LDS), and he considers it a Christmas gift to the community. I thought that was really cool.
One of the interesting news is that they are now going to start requiring a C99 compiler, instead of only C90.<p>I've been considering to do the same on my own projects. What does HN have to say about this? Is anyone here still working in a context where C99 is not an option? Did anyone else also recently switch to C99? How did it go?
> Calling a private method with a literal self as the receiver is now allowed.<p>Oof. Call me old fashioned, but I liked the consistency of not being able to call private methods with an explicit receiver. Oh well!<p>The rest of this looks great, thanks Ruby team!
I know it's slow at the moment, but is anyone planning on using pattern matching for anything in particular? Curious what use cases are particularly suitable for it.
Pattern matching is awesome in Elixir, it's great to see functional language traits stain the Ruby language more. It's all the better for it.
The compaction GC was the most important change. I haven't measured Ruby's performance specifically but in general the difference and improvements over a non-compacting GC is so huge. Specially for long running processes.
I'm most excited for <i>Enumerable#tally</i> for counting occurrences of elements.<p>From the example in the release:<p><pre><code> ["a", "b", "c", "b"].tally
#=> {"a"=>1, "b"=>2, "c"=>1}
</code></pre>
There's more about this change here (<a href="https://medium.com/@baweaver/ruby-2-7-enumerable-tally-a706a5fb11ea" rel="nofollow">https://medium.com/@baweaver/ruby-2-7-enumerable-tally-a706a...</a>). I probably do this a few times a week:<p><pre><code> list.each_with_object(Hash.new(0)) { |v, h| h[v.something] += 1 }</code></pre>
Does the pattern matching do something that Ruby's map() can't do?<p>Coming from Perl, map() there can return fewer elements than the source list, so pattern matching works already. A short skim of Ruby's map seems to imply it always returns something with the same number of elements.<p>Edit: I was confused about what this feature did. So this subthread is still interesting, but mostly unrelated.