help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: in-place operation semantics,


From: Jaroslav Hajek
Subject: Re: in-place operation semantics,
Date: Sun, 6 Dec 2009 21:22:40 +0100

On Sun, Dec 6, 2009 at 8:06 PM, Naveen Garg <address@hidden> wrote:
>>
>> > fortran_vec() is nice, but it would be even nicer if it could be a
>> > global,
>> > exported function and it took a pointer to octave values, and such a
>> > pointer
>> > could be obtained.
>>
>> I don't understand what you propose. Try to be more specific.
>>

> Currently, I don't see a way to use fortran_vec without first making a copy
> of an octave value.

fortran_vec is a method of the array class, not octave_value.

> Even if you create a new octave value in an oct file, there is no way to
> pass that octave value back.

Sure there is, you just return it in an octave_value_list.

> It gets copied and to a new pointer.

What? Please show an example code, I don't think we understand each other.

> Could we
> not mark certain octave values to be safe from garbage collection, so a
> persistent fortran_vec could be retained outside the .oct function call...
>

There is no garbage collection in Octave.
.

> ok, i found set_global_value in liboctinterp, but its name is mangled...
> Could it not be extern c ?

I don't see any reason for that. The whole API is C++, hence almost
all names are mangled. Besides, name mangling will be needed for
overloading, and even though there are no overloads now, there might
be in the future.

-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]