|
Posted by Jerry Coffin on 10/07/07 18:59
In article <13ghc3ros2h3231@corp.supernews.com>, alfps@start.no says...
[ ... ]
> This is all to simple. Please discuss Algol pass-by-name. Much more
> interesting, and a good candidate for inclusion in C++ -- at least, if
> we're going to achieve the goal of PL/1-killer! :-)
The Algol 60 standard is deceptively simple looking. The entire "Revised
Report on the Algorithmic Language" is only 17 pages -- about half as
long as the _index_ of the 2003 version of the C++ standard! Of that,
about a page and a half is devoted to a history of the committee
meetings and such.
Anyway, Algol supported both call by value and call by name. Since it's
raeasonably short I'll quote the entire section:
// Start of quote
4.7.3.1. Value assignment (call by value)
All formal parameters quoted in the value part of the procedure
declaration heading are assigned the values (cf. section 2.8 Values and
Types) of the corresponding actual parameters,these assignments being
considredd as being performed explicitly before entering the procedure
body. The effect is a though an aditional block embracing the procedure
body were created in which these assignments were made to variables
local to this fictitious block with types as given in their
corresponding specifications (cf. section 5.4.5). As a consequence,
variables called by value ar considered as nonlocal to the body of the
procedure, but local to the fictitious block (cf. section 5.4.3).
4.7.3.2. Name Replacement (call by name)
Any formal parameter not quoted in the value list is replaced,
throughout the procedure body, by the corresponding actual parameter,
after enclosing this latter in parentheses wherever syntactically
possible. Possible conflicts between identifiers inserted through this
process and other identifiers already present within the procedure will
be avoided by suitable systematic changes of the formal or local
identifiers involved.
// End of quote
If you're going to compare to C++, 'export' virtually springs to mind --
something that initially seems fairly inoccuous, but is virtually
impossible to implement, and probably doesn't accomplish what you want
when/if you do manage to get it "right".
--
Later,
Jerry.
The universe is a figment of its own imagination.
Navigation:
[Reply to this message]
|