Re: [stack] Re: Barebone implementation of concatenative language in c or c++
John Cowan <[email protected]> Wed, 21 Jul 2010 00:33:46 -0400
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
William Tanksley, Jr scripsit: > No; C++ allows call by reference semantics (explicitly specified, of > course) without being lazy at all. An early Fortran had implicit call > by reference, again not lazy (but, I'm told, very dangerous). I don't > use Perl, but I'm told it's call-by-reference. The default calling strategy for Fortran is and always has been call by reference. The dangerous bit was an implementation, not a specification, error. Buggy compilers conflated all instances of identical constants (thus there would be only one cell containing 5 no matter how many literal 5s there were in the code) without realizing that literals passed as arguments could not be conflated in such a manner. Perl is technically call-by-reference, but it is usual to provide lexically scoped variables that are mapped to the values of the call-by-reference parameters, and to assign them first thing in each procedure. The main exception is the comparison procedure passed to "sort", which uses by-reference arguments directly (always named "$a" and "$b") for speed. -- John Cowan [email protected] http://ccil.org/~cowan Assent may be registered by a signature, a handshake, or a click of a computer mouse transmitted across the invisible ether of the Internet. Formality is not a requisite; any sign, symbol or action, or even willful inaction, as long as it is unequivocally referable to the promise, may create a contract. --Specht v. Netscape