Skip to content
Paweł Gościcki

Paweł Gościcki

Random pieces of code, thoughts and movie reviews

Pages

  • Movie reviews
  • Projects
    • WP Movie Ratings

Recent movies

  • Broadchurch S02 (TV Series 2015)
    * * +

    Kinda meh. Kinda still watchable. A lot on fast forward though.

  • Broadchurch S01 (TV Series 2013)
    * * *

    Just okeyish. Expected something better.

  • Highest 2 Lowest (2025)
    * * +

    Watchable.

All movie ratings »

Archives

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Hash#fetch

{}.fetch(:a) { 0 }
=> 0

I think it’s really beautiful. Oh, and it’s Ruby, btw.

Update: this is even better:

{}.fetch(:a) { {} }
=> {}

Published by

Paweł Gościcki

Ruby/Rails programmer. View all posts by Paweł Gościcki

Posted on August 30, 2011June 19, 2022Author Paweł GościckiCategories programming, ruby

Post navigation

Previous Previous post: hookup is the shit!
Next Next post: My first pull request to a public project has been accepted
Proudly powered by WordPress