From: Nobuyoshi Nakada Date: 2006-11-15T18:48:05+09:00 Subject: Re: Proc as Observer Hi, At Wed, 15 Nov 2006 12:15:05 +0900, Trans wrote in [ruby-talk:225063]: > But your's doesn't work for immutables like NilClass. It's a a > bit more difficult in these cases. Have a clever solution? In any case > I'll take this and what I have and add it to Facets. Sorry, I'm not sure what you expect for NilClass. Isn't this the case? $ ./ruby -e 'nil.behaving(:foo){"Foo"}' -e 'p nil.foo' "Foo" > P.S. Would a cache on Behavior.new be a good optimization? It might be doubtful to be effective, since a Proc doesn't equal another Proc created in the same place almost. -- Nobu Nakada