[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: avoiding copying arguments by value when calling a function
From: |
c. |
Subject: |
Re: avoiding copying arguments by value when calling a function |
Date: |
Mon, 20 Aug 2012 16:00:55 +0200 |
On 20 Aug 2012, at 15:55, Sergei Steshenko wrote:
> Hello,
>
> if I understand correctly, if I write a function like this:
>
> function result = foo(bar)
> # function body goes here
> endfunction
>
> and if I call the function this way
>
> result = foo(bar);
>
> , the 'bar' argument is copied by value each time 'foo' is called.
>
This is not generally true, it does get copied if your function modifies "bar",
if "bar" is not modified it is not copied.
c.
- 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. <=
- 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