副作用其实就是说谎,你的函数本来要做一件事,但是却偷偷做了其他的事。
Side effects are lies. Your function promises to do one thing, but it also does other hidden things.
这就是为什么要使纯函数,即无副作用的函数,只能够调用其他纯函数想法的由来。
This is where the idea of making pure functions, functions without side-effects, able to call only other pure functions.
XQuery是一种高端的、强类型的函数语言(没有副作用),非常适合表达从XML文档或者大型XML存储库(repository)中获取数据的查询。
XQuery is a high-level, strongly-typed, functional language (free of side-effects) that is ideal to express a query to obtain data both from an XML document and a large XML document repository.
现在已经看到了函数性语言的基础,接下来可以开始了解,您要如何在没有副作用和对状态只有有限支持的环境下生活。
Now that you've seen the basics of a functional language, you can begin to see how you could live with no side effects and only limited support for state.
在fp里,函数没有副作用,变量都是不易变的。而在OOP中,可变状态和副作用都十分常见,甚至是被鼓励的。
In FP, functions have no side effects and variables are immutable, while in OOP, mutable state and side effects are common, even encouraged.
在函数式版本中,我提取了纯函数(即没有副作用的函数)并将其放入它们各自的类中,通过提供参数值来调用它们。
In the functional version, I extracted the pure functions (ones that have no side-effects) into their own class, calling them by supplying parameter values.
即使您不使用Static2的实例,该编译器仍然会创建这个新对象,以便不会遗漏调用该构造函数的任何副作用。
Even though you won't use the instance of Static2, the compiler will still create the new object so as not to miss any side effects of invoking the constructor.
产生副作用的一个更难以捉摸的原因,是在托管代码中计算属性和其他隐式函数调用。
A more subtle cause of side effects is the evaluation of properties and other implicit function calls in managed code.
为了避免可能的意外的副作用,不会在调试器每次步进时自动计算函数或方法。
To avoid possible undesired side effects, a function or method call is not automatically evaluated every time the debugger steps.
纯管道使用纯函数。纯函数是指在处理输入并返回结果时,不会产生任何副作用的函数。给定相同的输入,它们总是返回相同的输出。
A pure pipe USES pure functions. Pure functions process inputs and return values without detectable side-effects. Given the same input they should always return the same output.
请尽量保持你函数的纯洁性。所有的函数理想状态下都应该无副作用,请不要使用外部数据,同时返回的应该是一个新的对象而不是改变已有的。
Try to keep your functions pure. All functions should ideally produce no side-effects, use no outside data and return new objects instead of mutating existing ones.
可以使用实现后无副作用的纯函数编写转换。
Transformations can be written using pure functions that are implemented without side effects.
高级语言中子程序的副作用是指子程序(过程和函数)对全程量或非局部量的改变。
In advanced language program, the side effect of the subprogram is referred that the subprogram (procedure or function) change public variable or no local variable.
如果公共语言运行时(CLR)函数被标记为确定的,则它应该不会在远程服务器中导致副作用。
If the common language runtime (CLR) function is marked as deterministic, it should not cause side-effects in the remote server.
由于这些副作用可能会使调试更加困难,因此调试器通常会关闭属性和隐式函数调用的自动计算。
Because these effects can make debugging more difficult, automatic evaluation of properties and implicit functions calls by the debugger is often turned off.
属性以及隐式函数调用的计算可能会产生副作用,影响程序的状态。
Evaluation of properties and implicit function calls can have side effects that affect the state of your program.
要知道如果一个函数有副作用,只需看其签名的能力是非常有用的当试图了解函数是干什么的。 少一个函数可以做的越少,你要明白!
The ability to know if a function has side effects just by looking at its signature is very useful when trying to understand what the function does.
要知道如果一个函数有副作用,只需看其签名的能力是非常有用的当试图了解函数是干什么的。 少一个函数可以做的越少,你要明白!
The ability to know if a function has side effects just by looking at its signature is very useful when trying to understand what the function does.
应用推荐