il Sun, 6 Jun 2004 17:10:57 +0900, Jeff Mitchell <quixoticsycophant / yahoo.com> ha scritto:: > > >Why should you expect [] to imply hash-like behavior in the first place? It's >just a convenience method. What was the problem with the #lookup and #store >suggestion at [ruby-talk:102505]? I believe Sean is correct in saying that what he defines as hash-like behaviour is usage of [] with arbitrary objects. S uggesting fetch and store is ok, but for many things it does not work (say, pstore does not seem to have #store and #lookup, yet it has hash-like behaviour via []) BTW I believe that having a tagged interface would not fit anyway: Say the user of the method has to write: obj.implements(:"Hash-like-[]") before foo(obj). At this point I'd prefer to just ask him for proper fetch and store. Just IMVHO.