hamstergem/hamster — pull request #97 by alexdowad (2014-06-21 18:54:49+00:00)
Title: More concise (and faster) implementation of Hamster::Tuple

The title says it all.

I suspect that a lot of experienced Ruby programmers don't know this trick. When you subclass a core Ruby class like Array/Hash/String, the Ruby runtime will use the exact same (efficient) data representation "under the hood" for your subclass as it does for the built-in class. Additionally, built-in methods which have a special-cased "fast path" when passed an Array, etc. will generally use the fast path for your subclass as well.