Deutsch   English   Français   Italiano  
<utft6a$1pfg9$4@dont-email.me>

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

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Lawrence D'Oliveiro <ldo@nz.invalid>
Newsgroups: comp.lang.scheme
Subject: Re: on call by reference
Date: Wed, 20 Mar 2024 23:58:02 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <utft6a$1pfg9$4@dont-email.me>
References: <877chyiosp.fsf@tudado.org> <utetgj$1hs9g$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 20 Mar 2024 23:58:02 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="badb6633f042ee08dd03f65d8f49603e";
	logging-data="1883657"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18ugnUeiINgyEDGAowWktXq"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:j3q+HEzV9M3QzI+oCW0SWIHFE9c=
Bytes: 1641

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