Project

General

Profile

Actions

Feature #13645

open

Syntactic sugar for indexing when using the safe navigation operator

Added by ndn (Nikola Nenkov) over 4 years ago. Updated over 2 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:81629]

Description

Proposal

While it works and makes sense, this is a bit cumbersome:

hash&.[](:key)

Ideally, we could use something like:

hash&.[:key]

Related issues

Is duplicate of Ruby master - Feature #11813: Extend safe navigation operator for [] and []= with syntax sugarRejectedmatz (Yukihiro Matsumoto)Actions
Actions

Also available in: Atom PDF