Project

General

Profile

Actions

Bug #937

closed

Recursive Hashes As Keys

Added by dgtized (Charles Comstock) over 15 years ago. Updated almost 13 years ago.

Status:
Rejected
Target version:
ruby -v:
[ruby-core:20927]

Description

=begin
On 1.8.7 hashes which use themselves as keys appear to lack a meaningful value, yet are stored correctly in the keys and values list.

$ ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
$ ruby -e 'h = {}; h[h] = h; p h,h[h],h.keys[0],h.values[0]'
{{...}=>{...}}
nil
{{...}=>{...}}
{{...}=>{...}}

Is this intended behavior or a bug?
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0