4 ms·
2.1.0p0 :001 > x = def foo() puts "hello"; end => :foo 2.1.0p0 :002 > def eval_it_now_bitch! lulz 2.1.0p0 :003?> eval lulz.to_s 2.1.0p0 :004?> end => :
by UNIXgod 13y ago
2.1.0p0 :001 > x = def foo() puts "hello"; end
=> :foo
2.1.0p0 :002 > def eval_it_now_bitch! lulz
2.1.0p0 :003?> eval lulz.to_s
2.1.0p0 :004?> end
=> :eval_it_now_bitch!
2.1.0p0 :005 > eval_it_now_bitch! x
hello
=> nil
- UNIXgod 13y agoI actually thought that the new feature of def yielding the symbolic name of the newly defined function was interesting, if for anything to open up new areas where there was a limit before on building lookup tables for macro and meta programming techniques with either DSL creation and|or basic ruby hacking for fun.