3 ms·
1. Sheer comparison for equality is used. (It is user definable.) For e.g. built-in hashes, contents must compare equal. 2. The store is a hashtable. 3. Multi
by andralex 12y ago
1. Sheer comparison for equality is used. (It is user definable.) For e.g. built-in hashes, contents must compare equal.
2. The store is a hashtable.
3. Multiple arguments are grouped in a tuple - no major complication.
4. Where memoization doesn't make sense you'll get a compile-time error because e.g. comparison for equality is't defined. At least most of the time :o).
5. The memory is thread-local.
6. memoize takes the name of the memoized argument and creates a distinct type for each memoized function.
TL;DR: business as usual
- delluminatus 12y ago> 1. Sheer comparison for equality is used. (It is user definable.) For e.g. built-in hashes, contents must compare equal. Wow, so if you compare aHash == anotherHash, it doesn't just compare the references, it actually examines both hashes for content equivalence? That's fairly unconventional, but probably convenient sometimes.
- andralex 12y agoAffirmative. Use "aHash is anotherHash" to compare references.