Curry过的闭包可以用来模拟Visitor模式的基本元素,正如在Library例子中显示的。
Curried closures can be used to mimic the essential elements of the Visitor pattern, as we showed in the Library example.
如果请求,则将编译过的应用程序安装到正在使用的文件系统,并记录所有安装的文件,以便日后可以方便地将包卸载。
If requested, install the compiled application into the live filesystem, recording all installed files so that the package can be easily uninstalled at a later date.
清单11演示了curry过的闭包的应用:测试系统架构的完整性。
Listing 11 demonstrates the application of curried closures to put the heat on (that is, test) a system's architectural integrity.
I'll compute its value. Then I'll empty the backpack out, put another combination of stuff compute its value, try all possible ways of filling up the backpack, and then when I'm done, I'll know which was the best.
直至把它填满,然后计算价值,然后我把包里的东西都导出来,再换一堆东西计算它们的价值,尝试过所有填满包的方案后,我就知道哪一种方案是最好的了。
应用推荐