Ruby 2.3 introduced the ```#dig``` method as a general way to access elements in deep structures. Initially it was implemented only for ```Array``` and ```Hash```. In the meanwhile also the classes ```Struct```, ```OpenStruct``` and ```S...janfri (Jan Friedrich)
akash (Akash Gupta) wrote: > The method `merge_if` / `merge_if!` will merge the passed hash in parameter only if the block evaluates to true, otherwise not. Similar to `count` method with a block. What if the callee has more than one...janfri (Jan Friedrich)
I like the ampersand prefix of Elixir: ```elixir Enum.map [1, 2, 3], &(&1 + 2) # => [3, 4, 5] Enum.reduce [1, 2, 3], &(&1 + &2) # => 6 ``` The ampersand (&) relates more to a block in Ruby than an at-sign (@) which is associated...janfri (Jan Friedrich)
zverok (Victor Shepelev) wrote: > 1) Ruby has very consistent "argument **deconstruction**" rules. Basically, "it is deconstructed the same way it is constructed", e.g., if you can _call_ (construct) with arguments like `meth(a, *b, c: ...janfri (Jan Friedrich)
Just my 2 cents: I'm not a native English speaker. Never heard the word "tally" before. So I would never remember it and has always to look at the api docs.janfri (Jan Friedrich)
matz (Yukihiro Matsumoto) wrote: > As a conservative old timer who does not use JavaScript at all, I still feel negative. It seems to work best with destructuring (left-hand side of assignments) which is nearly impossible in current Rub...janfri (Jan Friedrich)
As Naruse in DevelopersMeeting20180809 mentioned: It is a histogram function. How about ```histogram_by``` (and for the block-less counterpart ```histogram```)?janfri (Jan Friedrich)
duerst (Martin Dürst) wrote: > I have been able to 'solve' this problem by adding > ... Hey this is my patch. ;-) I did the same and it worked for me. But for the actual trunk it seems not longer to be necessary?janfri (Jan Friedrich)