Project

General

Profile

Feature #9402

A syntax to specify the default value of a hash

Added by alexeymuranov (Alexey Muranov) almost 6 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:<unknown>]

Description

I propose the following syntax to specify the default value of a hash:

h = { => 0, :a => 1, :b => 2 }
h[:a] # => 1
h[:c] # => 0

Also available in: Atom PDF