Project

General

Profile

Actions

Feature #9402

open

A syntax to specify the default value of a hash

Feature #9402: A syntax to specify the default value of a hash

Added by alexeymuranov (Alexey Muranov) almost 12 years ago. Updated almost 4 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: PDF Atom