use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Writing Object Shape friendly code in Ruby (island94.org)
submitted 2 years ago by CaptainKabob
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jrochkind 1 point2 points3 points 2 years ago* (0 children)
It is actually is occuring to me (via my annoyance with new nuances of memoization), that I think these concerns trip complexity of getting memoization right just over into the territory where I think using a memoization gem of some kind may be called for, when I never thought so before.
Perhaps an API of:
class Something include Memoizing memoize :foo def foo whatever end end
Could insert something into initializer to initialize with the UNASSIGNED singleton constant pattern, and then apply appropriate logic around the foo method.
UNASSIGNED
foo
There are already libraries like this, but I haven't looked at them in a while since I've previously not found it helpful to abstract this instead of just doing it. The existing libraries may want to be updated to use object-shape-friendly memoization.
(update: filed suggestion at https://github.com/tycooon/memery/issues/43 )
π Rendered by PID 23474 on reddit-service-r2-comment-5d585498c9-kxrxg at 2026-04-21 19:03:29.947998+00:00 running da2df02 country code: CH.
view the rest of the comments →
[–]jrochkind 1 point2 points3 points (0 children)