Deutsch   English   Français   Italiano  
<utg0r4$1qdpg$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Schol-R-LEA <alicetrillianosako@gmail.com>
Newsgroups: comp.lang.scheme
Subject: Re: on call by reference
Date: Wed, 20 Mar 2024 21:00:20 -0400
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <utg0r4$1qdpg$1@dont-email.me>
References: <877chyiosp.fsf@tudado.org> <utetgj$1hs9g$1@dont-email.me>
 <utft6a$1pfg9$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 21 Mar 2024 01:00:20 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e0a575d7620ab5e169a2a9922223a30b";
	logging-data="1914672"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19BPWHv0xQ3goxGB+8RptYpGH2zxpeADsU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:hEkcAwBUJECFFMvivmpCoEGB9wk=
In-Reply-To: <utft6a$1pfg9$4@dont-email.me>
Content-Language: en-US
Bytes: 1955

Lawrence D'Oliveiro:
> On Wed, 20 Mar 2024 10:57:18 -0400, Schol-R-LEA wrote:
> 
>> Languages such as C and C++ are interesting in this regard, as they have
>> only call-by-value semantics, but also support passing explicit
>> pointers, which allows them to simulate call-by-reference semantics by
>> the passing of explicit pointers.
> 
> C++ allows “references”, where the “pointer” part is no longer explicit.
> E.g.
> 
>      ResType Func
>        (
>          ArgType & Arg
>        )
>        {
>          ...
>        } /*Func*/
> 
> But of course this is not tied to function arguments at all, and can be
> used elsewhere, e.g.
> 
>      int A;
>      int & const B = A;
> 
> Now any assignment to “B” actually changes the value of “A”.


I had forgotten about C++ opaque references. Thank you for pointing that 
out.