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

  • Le Comte de Monte-Cristo / The Count of Monte-Cristo (2024)
    * * * * +

    Very good. Great story, good to be refreshed every 20 years or so.

  • The Assessment (2024)
    * *

    Meh. Exaggerated. Mediocre.

  • Le bureau des légendes / The Bureau S05 (TV Series 2020)
    * * * *

    Malotru, I'll be missing you.

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