30 Apr '13, 2pm

Double pipe equal sign mystery is solved

Hashes with default values act in an.. interesting way, depending on your point of view. Merely accessing a value doesn't mean that the value is reified (made concrete) in the hash itself. The reason for this is that you can assign Procs to a hash's default_proc in order to perform calculations (or even to set values) when an unset key is accessed. It would be undesirable to avoid this behavior merely because a key was accessed earlier on.

Full article: http://www.rubyinside.com/what-rubys-double-pipe-or-equal...

Tweets

Top Ruby Article: Double Shot #1119:

afreshcup.com 01 May '13, 11am

is Mike Gunderloy's software development weblog, covering Ruby on Rails and whatever else I find interesting in the univer...