Ralf M?ller ha scritto: > thanks robert, > this lambda mechanism is an interessting point. > What you do, is an in-place-extension of 'class' only for its actual > instance 'object', right? He's adding that method to the singleton class of 'crit1'. actually I prefer: def crit2.===(z) call ; end this may be of interest to you: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/104332 It explains singleton classes in a lovely way :) > And you call it '===', because 'case' needs > this functcion. > But whitch alias do you choose for 'crit2? > crit2 = lambda {|x| x.id == 'whatever'} def crit2.===(z) call ; end but /I/ prefer: