请注意,由于add函数的输入参数在运行时被绑定到int类自变量,因此产生了数值的增加。
Note that a numeric addition has occurred because the input parameter to the add function is bound to an int type argument at function execution time. Now, try this.
函数可以存储于关联数组中(关联数组是这样一类数组:它们按名称而不是数值索引)。
Functions can be stored in associative arrays (arrays that are indexed by names rather than Numbers).
在函数式版本中,我提取了纯函数(即没有副作用的函数)并将其放入它们各自的类中,通过提供参数值来调用它们。
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.
应用推荐