From: Joel VanderWerf Date: 2004-01-27T07:39:00+09:00 Subject: Re: def foo[](x) Gavin Kistner wrote: > David Heinemeier Hansson wrote: > >> I've been puzzled by this myself. There has been many times where I've >> wanted to fake the appearance of a collection within a class without >> actually making another class just for the purpose. >> >> Could this perhaps make it in as an RCR? > > > I'm glad I'm not the only one. I have now added this as an RCR: > http://www.wobblini.net/rcr/RCR/RCR201 Question: in this method call: x.foo[1] what is the search order? First for #foo, and then for #foo[]? Or the other way around? Suppose it's #foo, then #foo[]. What if #foo is implemented in the superclass, but #foo[] is implemented in the class of x itself? In other words, depth-first search or breadth-first search? It seems difficult to resolve the ambiguities inherent in this notation. (But I have sometimes wished this feature existed.)