Pass-By-Name Parameter Passing(收录)
来源:互联网 发布:玻璃优化排版软件下载 编辑:程序博客网 时间:2024/05/17 23:07
Rather than using pass-by-reference for input/output parameters, Algol used the more powerful mechanism of pass-by-name.
In essence, you can pass in the symbolic "name"; of a variable, which allows it both to be accessed and updated.
For example, to double the value of C[j]
, you can pass its name (not its value) into the following procedure.
procedure double(x); real x;begin x := x * 2end;
In general, the effect of pass-by-name is to textually substitute the argument expressions in a procedure call for the corresponding parameters in the body of the procedure, e.g., double(C[j])
is interpreted as C[j] := C[j] * 2
.
Technically, if any of the variables in the called procedure clash with the caller's variables, they must be renamed uniquely before substitution.
Implications of the pass-by-name mechanism:
- The argument expression is re-evaluated each time the formal parameter is accessed.
- The procedure can change the values of variables used in the argument expression and hence change the expression's value.
- Pass-By-Name Parameter Passing(收录)
- upvar, pass by name
- scala by-name parameter
- Parameter passing in Java - by reference or by value?
- C# Parameter: Pass object by value, The copy constructor
- JAVA菜鸟入门(3) Function parameter : pass by value, always!
- parameter passing in python
- C+复习Parameter Passing
- parameter passing in Java demo
- parameter passing in python DEMO
- passing arguments by reference
- Parameter passing using Javascript+actionFunction in visualforce
- Pass by value & pass by reference
- pass by value & pass by reference
- pass by value vs pass by reference
- C++编程常见问题—error: passing 'const std::map<>]' discards qualifiers或pass-by-reference-to-const-map导致的“d
- when love's passing by...
- Revisit pass by value
- lp/mm(线对/毫米
- Theme Resource for Windows Phone
- 【Tiptop ERP M】Tiptop GP ERP APM采购管理系统
- 09 C# 第八章 值类型 ------ 装箱操作和枚举的使用
- 关闭Visual Studio 2008 实时调试器 关闭实时调试器
- Pass-By-Name Parameter Passing(收录)
- C语言学习笔记1——存储类、链接和内存管理
- 程序员的解说
- MyEclipse 快捷键
- MYSQL查询重复记录的方法
- 我对创业和管理的一些看法
- 蛇年谈程序员发展之路
- 【Visual C++】游戏开发笔记四十四 浅墨DirectX教程十二 网格模型和X文件使用面面观
- 常用Xpath对照表