(I think you filed this in the wrong section; right now it is under Bugs, but it looks
like a feature so it should go into
https://bugs.ruby-lang.org/projects/ruby-trunk/issues?set_filter=1&tracker_id=2 )
At any rate, to the suggestion itself:
I am already biased because I am not a big fan of object&.method for various reasons,
some of which are a personal preference (but also because my eyesight is not the best).
However had, you don't have to convince me - you ultimately only have to convince
matz (and it helps to convince the core team too).
Aside from any personal bias, I think there may be more objective reasons against the
proposal from a syntax and "meaning" point of view.
I may be mistaken, but I believe
collection.map(&:instrument)
always meant a to_proc call (e. g. https://stackoverflow.com/a/8793693/722915 ).
This was probably also one reason why it could not too easily be extended to
also allow for arguments passed into it, e. g. anything where you
pass stuff into the method that is called there.
Having object.map(&:foo) suddenly mean object.map { |e| e&.foo } is, I think,
re-defining existing behaviour. Perhaps there are cases where this new behaviour
would be undesired? But I may be wrong; I make use of & only very sparingly
so in the ruby code I write/use.
Aside from this, the net gain seems to be fairly small.
I understand succinctness being a good thing usually but I don't really see any
real net gain here.
As for intermediate nil values - to be honest I think it is possible to design
methods in such a way as to act as a filter, and discard nil values when they
are not necessary to begin with (e. g. making more use of .compact). But as
written above, you ultimately have to only convince matz. You can suggest to
add it to the next developer discussion to get the opinion(s) of the core
devs if you would like to, at:
https://bugs.ruby-lang.org/issues/15129