Copyright Preface xv Chapter 1. Introduction 1 Section 1.1. What Is an Operating System? 4 Section 1.2. History of Operating Systems 6 Section 1.3. Operating System Concepts 19 Section 1.4. System Calls 26 Section 1.5. Operating System Structure 42
我们来简单地描述Ruby的一个独特特性。Block,一种可以和方法调用相关联的代码块,几乎就像参数一样。这是一个不可思议的功能强大的特性。
可以用Block实现回调(但它比Java的匿名内部(anonymous inner)类更简单),传递一组代码(但它远比c的函数指针灵活),以及实现迭代器。
Block只是在花括号或者do…end之间的一组代码。
{puts Hello} #this is a block
do ###
c