示性函数有多种含义,它可以指事件的示性函数,即事件发生与否与0,1两值函数的对应关系。也可以指随机过程的示性函数,即随机过程的均值函数、方差函数、相关函数等。还可以指集合的示性函数,即集合的特征函数。其中事件的示性函数也可以归于集合的示性函数,二者都是与0,1二值函数相关的。
如清单3所示,它不仅删除函数,还消除了调用者管理subprocess_info结构的必要性。
As shown in Listing 3, this not only removes a function but also removes the need for the caller to manage the subprocess_info structure.
由于高阶函数的可用性,确定数字是否完全的整个问题在Groovy中只需几行代码即可完成,如清单7所示。
With the availability of higher-order functions, the entire problem of determining if a number is perfect or not collapses to a couple of lines of code in Groovy, as shown in Listing 7.
应用推荐