常常可以发现bug的原因是调用者发送了类型错误的参数或数量错误的参数,或者实际参数和形式参数的次序不匹配。
Often, you can trace the origin of a bug back to a caller that's sending the wrong type of argument, the wrong number of arguments, or a mismatch between the order of actual and formal arguments.
也能提醒实际参数和形式参数的使用过程:调用一个函数的时候,把实际参数的值赋给了形式参数。
It is also a reminder about how arguments and parameters work: when you call a function, the arguments are assigned to the parameters.
实际参数:当函数被调用的时候,提供给函数的值。这个值会被函数接收,赋给函数内部的形式参数。
A value provided to a function when the function is called. This value is assigned to the corresponding parameter in the function.
程序体中每当引用形式参数时,就调用形实替换程序。
For each reference to a formal parameter in the body of the procedure, a call of this thunk appears.
使用名字调用时,包含有用参数对形式参数进行原文替换的意思。
The use of a call by name parameter implies a textual substitution of the formal parameter name by the actual parameter.
使用名字调用时,包含有用参数对形式参数进行原文替换的意思。
The use of a call by name parameter implies a textual substitution of the formal parameter name by the actual parameter.
应用推荐