From: Kent Dahl Date: 2002-06-03T21:36:15+09:00 Subject: Re: Does assert() exist? Nikodemus Siivola wrote: > On Mon, 3 Jun 2002, Kent Dahl wrote: > > would get the binding of the caller in an elegant way. > def foo; bar; end > def bar; caller; end Unless this has changed in 1.7.* or something, it still doesn't give me a binding object I can pass to eval and such. irb(main):001:0> def foo; bar; end nil irb(main):002:0> def bar; caller; end nil irb(main):003:0> a = foo ["(irb):1:in `foo'", "(irb):3:in `irb_binding'", "/usr/lib/ruby/1.6/irb/workspace.rb:51:in `irb_binding'", "/usr/lib/ruby/1.6/irb/workspace.rb:51"] irb(main):004:0> a.type Array This is all nice enough for logging, but not for evaluating code in the context of the 'caller-parent', which is necessary for the assert to work. -- (\[ Kent Dahl ]/)_ _~_ __[ http://www.stud.ntnu.no/~kentda/ ]___/~ ))\_student_/(( \__d L b__/ NTNU - graduate engineering - 4. year ) ( \__\_�|�_/__/ ) _)Industrial economics and technological management( \____/_�_\____/ (____engineering.discipline_=_Computer::Technology___)