Code reuse is an obvious development goal, and imperative abstractions tend to solve that problem differently from the way that functional programmers solve it.
代码重用是一个显著的开发目标,而命令式抽象倾向于用不同于函数式程序员解决问题的方法来解决问题。
The declarative information is transformed into an imperative form at compile-time, rather than each time it is used at runtime, resulting in faster code.
声明式信息在编译时转换为命令形式,而不是在运行时每次使用时进行转换,这使代码更快。
Since the macro expands to regular code anyway, you can always switch back to imperative programming if the declarative language doesn't suit your needs.
因为宏可以以任何方式展开常规代码,所以如果声明式语言不能满足需要,那么随时可以切换回命令式编程。
Just as I did with the imperative versions, I extract the duplicated code into its own factors class, changing the name of the factors method to of for readability, as shown in Listing 8.
正如我在命令式版本中所做的一样,我将重复的代码提取到其factors类中,并且为便于阅读,将factors方法的名称改为of,如清单8所示。
It is imperative to use a unique error code for this parameter to distinguish this problem from others.
这个参数强制使用特殊的错误代码,以使该问题区别于其他问题。
It is imperative to use a unique error code for this parameter to distinguish this problem from others.
这个参数强制使用特殊的错误代码,以使该问题区别于其他问题。
应用推荐