检测递归方法调用的最佳方法是什么?或许,可以做成这样的格式:
def foo
if some_code_to_detect_recursive_call
...
else
...
end
end
Run Code Online (Sandbox Code Playgroud)
我可以想出一种解析caller
信息的方法,但我有兴趣看看是否有更好的方法。
归档时间: |
|
查看次数: |
471 次 |
最近记录: |