From: Aldric Giacomoni on
I decided to type the following in irb:
irb(main):010:0> a = {}
=> {}
irb(main):015:0> a[lambda { x } => 5] = 5
=> 5
irb(main):016:0> a
=> {{#<Proc:0x028cb304@(irb):15>=>5}=>5}

irb(main):017:0> a = {}
=> {}
irb(main):018:0> a[lambda { x } ] = 5
=> 5
irb(main):019:0> a
=> {#<Proc:0x028c2a4c@(irb):18>=>5}

So.. In the first example, the hash key is 'lambda { x } => 5' .
What on earth does that even mean?

In the second one, the hash key is a lambda. Does that even serve any
purpose beyond just being the key for whatever value I choose to
associate with it?
--
Posted via http://www.ruby-forum.com/.