octave-maintainers
[Top][All Lists]
Advanced

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

Re: saving function handles


From: Max Brister
Subject: Re: saving function handles
Date: Fri, 16 Nov 2012 16:37:10 -0700

On Fri, Nov 16, 2012 at 6:24 AM, Muhali <address@hidden> wrote:
>>> Why not save the function code itself? Then you don't need any paths.
>
>> That would create issues if you have any persistent variables in your
>> function.
>
> hm ... What is so different between a simple string and a string on a
> filesystem?
>
> M.

The issue is that the string on your system and the string in the file
will be parsed separately. Say you have a function
function x = foobar
  persistent y
  x = y;
  y = y + 1;
endfunction

then there would be two instances of y, one loaded from the function
handle and the other loaded from the file system.

-- 
Max Brister


reply via email to

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