[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Call by Reference
From: |
fork |
Subject: |
Re: Call by Reference |
Date: |
Fri, 22 Oct 2010 17:24:43 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Erik Stensmo <erik.stensmo <at> gnistra.se> writes:
> I found some pages stating that Octave does not support call by reference. As
I understood it, if you modify a function argument (such as an element in a
matrix passed as an argument), Octave will copy the argument (and hence make a
call by value). How are you supposed to write well structured code without a
performance hit? Include files? I think Octave should support call by
reference.
Call by reference would break ML compatibility, make debugging code harder, and
with "copy on write" is much less of a performance hit than you might think.
Additionally, if you are doing something so intense you DO need references, you
might want to write a portion of it in C, C++, or Fortran and compile it into a
function: "help mkoctfile"
>
>
> _______________________________________________
> Help-octave mailing list
> Help-octave <at> octave.org
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>