Robert,

first of all, thank you for your comments!

> difficult to track down since nobody expects this (if it's done
> automatically)

this is not done automatically, the programmer explicitly
includes a Mixin.

> You're likely to run into name clashes and such

only lru_next/lru_prev/lru_key are added to the class to be cached,
I think name clashes are very unlikely.

> Using an Array as list storage comes to mind.

This was the original method used, but in order to make this
efficient I had to use lookup by pointer AND a lookup by the
caching key, so I swtiched to a custom structure. If you can
adapt the code to use an Array and no mixin, I will be
impressed :)

Your last idea is rather interesting, but the gain (no mixin) does not
justify the complexity. I use this cache in a simple Fragment caching
scheme for web applications and it seems perfectly natural to
write code like:

class Fragment
include N::LRUCache::Item
attr_accessor :body, :last_modified, :expires
....
end

Hope this is useful to other people as well.
best regards,
George Moschovitis