且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么这种救援语法有效?

更新时间:2023-11-20 19:45:16

rescue在方法中不需要绑定到显式的begin,这就是定义语法的方式.有关示例,请参见此处#19 上面的骗子.

rescues do not need to be tied to an explicit begin when they're in a method, that's just the way the syntax is defined. For examples, see #19 here and this SO question, as well as the dupe above.