![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Ruby进阶
iteye_14748
这个作者很懒,什么都没留下…
展开
-
对《Ruby入门》元编程的解释
有同学表示第九章元编程的例程不好理解。先道歉,因为能力不足于游刃有余地表达元编程的方方面面,所以我选择了只演示最简单的元编程,而不展开解释。下面给出例程的一点注释,不保证你能理解。对于入门,知道Ruby长于元编程就可以了。ruby 代码 class MetaPerson def MetaPerson.method_missin...2007-02-11 00:21:44 · 96 阅读 · 0 评论 -
变量一定要有类型吗(一)
先讨论一下Ruby是不是强类型。1).在《Beyond Java》[size=7]September 2005[/size] 一书 6.1.2节Typing 中,Bruce Tate举例 irb(main):015:0> "fish"+4 TypeError: cannot convert Fixnum into String fro...2007-03-01 06:30:00 · 247 阅读 · 0 评论 -
变量一定要有类型吗(二)
变量一定要有类型吗(二)变量一定要有类型吗?不一定。在《The Ruby Way 2nd》一书中,1.2.3节 Constants, Variables, and Types“In Ruby, variables do not have types, but the objects they refer to still have types. ” 在Ruby中,变量没...2007-03-01 07:05:38 · 319 阅读 · 0 评论