可以用另一个便利函数抽象这个过程,如清单5所示。
You can abstract this out with yet another convenience function, shown in Listing 5.
以未确知测度为隶属函数抽象出论域上的未确知集合概念,定义未确知集合的运算。
Then it is used as a membership function, and based on it, the concept of unascertained set in domain is introduced, the operations of the unascertained set are defined.
在我们当前的树访问者函数中可以轻松抽象这些函数,并支持预构建和自定义的迭代策略。
It is easy to abstract these functions in our current tree-visitor function and allow for pre-built and custom iteration strategies.
What is this? This is a wonderful piece of abstraction. It is saying, you don't need to know squat about what's inside the body of this function. You don't have to worry about the parameter names, because they're going to be preserved, you don't need to worry about how I'm doing it, this tells you how you can use this, in order to use it correctly. Of course, I can then close it off, and off we go.
但是这能告诉你一些信息,这是什么?,这是一段完美的抽象,它的意思是你不需要知道,这个函数的内部构造,你不必担心参数是否重名,因为它们已经被预存了,你不需要担心我如何使用它,它告诉了你你该如何操作,从而正确的使用它,当然我也可以把它关掉。
or at least one mechanism, I shouldn't say -- the only one-- one mechanism for doing that is going to be to add functions is that it's going to provide both of these things, so the first thing it's going to do is, it's going to let us break up into modules.
我们处理这些的机制--至少一种机制,我不会说只有一种,一种机制是在我们的语言中增加函数,函数的关键是它要提供分解和抽象,所以第一件要做的事,就是将代码分解为模块。
应用推荐