From: Vasco Andrade e Silva Date: 2007-11-16T19:36:10+09:00 Subject: Re: Shadowing bug?? Robert Klemme wrote: > 2007/11/15, Vasco Andrade e Silva : >> >> {:xpto=>"ohoh"} # :-) >> process of that computation you call "defn_to_sexp". This method >> ... >> in both cases". >> ... >> end > > IMHO you are abusing a lambda to get a nested method. This likely > also has performance impacts since the block has to be recreated on > every invocation of the method. In this case I'd rather use a private > helper method. > > But I can see how you would want to use the same identifier in some > cases. I can only speak for myself: I did not feel the urge to do > this (yet). I think that has to do a lot with your "school". Have a try with it, i'm sure you'll love it after while :P > > Cheers > > robert Let me only add if you want performance in this case you could just do: @process_args ||= lambda do |node, has_block| ... # i don't want to access to the outer node # and "node" says more than "n" end this is a very simple cache system ;) Regards, Vasco -- Posted via http://www.ruby-forum.com/.