Re: [stack] Re: Barebone implementation of concatenative language in c or c++

Don Groves <[email protected]> Tue, 20 Jul 2010 22:57:50 -0700
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
On 20 Jul 2010, at 21:33, John Cowan wrote:

> 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.

And there was also the problem of the called routine's ability to
change the value of a constant so passed. There were some pretty
neat obfuscations around due to this feature though...

don


> 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
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>