[心得] 看似遞迴..

看板Ruby作者 (LCamel)時間17年前 (2007/12/09 22:28), 編輯推噓2(200)
留言2則, 2人參與, 最新討論串1/1
actionpack-1.13.6/lib/action_controller/routing.rb 465 # Write the real recognition implementation and then resend the message. 466 def recognize(path, environment={}) 467 write_recognition 468 recognize path, environment 469 end 實驗: $ cat ~/a.rb o = Object.new def o.foo puts "1" instance_eval("def foo; puts 'hi'; end") puts "2" foo puts "3" end o.foo puts "===========" o.foo $ ruby a.rb 1 2 hi 3 =========== hi -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.167.155.183

12/09 22:32, , 1F
真噁心 @_@
12/09 22:32, 1F

12/09 22:34, , 2F
這大概可以說是自我更新吧 @_@b
12/09 22:34, 2F
文章代碼(AID): #17M_k0LO (Ruby)
文章代碼(AID): #17M_k0LO (Ruby)