Project

General

Profile

Actions

Feature #9402

open

A syntax to specify the default value of a hash

Added by alexeymuranov (Alexey Muranov) almost 11 years ago. Updated almost 3 years ago.

Status:
Open
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
Actions

Also available in: Atom PDF

Like0
Like0