[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: avoiding copying arguments by value when calling a function
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: avoiding copying arguments by value when calling a function |
Date: |
Mon, 20 Aug 2012 10:29:59 -0400 |
On 20 August 2012 10:25, Sergei Steshenko <address@hidden> wrote:
> On Mon, 8/20/12, Carnë Draug <address@hidden> wrote:
>> On 20 August 2012 14:55, Sergei Steshenko <address@hidden>
>> wrote:
> [snip]
>> Seems the manual
>> http://www.gnu.org/software/octave/doc/interpreter/Call-by-Value.html
>> is incorrect.
> [snip]
>> Carnë
>>
>
> FTM: "each argument in a function call is evaluated and assigned to
> a temporary location in memory before being passed to the function."
>
> well, in the light of given explanations indeed incorrect. i.e. bug
> in documentation.
COWs look like pass by value if you ignore memory allocation. From the
user's point of view, a COW *is* pass by value. COWs are supposed to
be a transparent optimisation. This is why the manual further down
says,
Even though Octave uses pass-by-value semantics for function
arguments, values are not copied unnecessarily.
I don't think there is a documentation bug.
- Jordi G. H.
- avoiding copying arguments by value when calling a function, Sergei Steshenko, 2012/08/20
- Re: avoiding copying arguments by value when calling a function, Michael Goffioul, 2012/08/20
- Re: avoiding copying arguments by value when calling a function, c., 2012/08/20
- Re: avoiding copying arguments by value when calling a function, Sergei Steshenko, 2012/08/20
- Re: avoiding copying arguments by value when calling a function, Jordi Gutiérrez Hermoso, 2012/08/20
- Re: avoiding copying arguments by value when calling a function, Carnë Draug, 2012/08/20
- Re: avoiding copying arguments by value when calling a function, Sergei Steshenko, 2012/08/22