[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: saveing/loading symbol table of annymous functions
From: |
David Bateman |
Subject: |
Re: saveing/loading symbol table of annymous functions |
Date: |
Mon, 09 Apr 2007 18:31:45 +0200 |
User-agent: |
Thunderbird 1.5.0.7 (X11/20060921) |
John W. Eaton wrote:
> On 6-Apr-2007, David Bateman wrote:
>
> | Looking at how to read matlab dot-mat files with anonymous function
> | handles in them, it seems that these files contain the local symbol
> | table of the anonymous function. Octave also stores these in
> | tree_anon_fcn_handle, as the octave saving/loading of anonymous function
> | handles are in ov-fcn-handle.cc, we don't have access to the local
> | symbol. This is true both for loading and saving the symbol table.
> |
> | Can the symbol table be moved from the tree_anon_fcn_handle class to the
> | octave_fcn_handle class? What else does this imply? If it is moved it
> | would then by possible to save the symbol table of the function handle
> | and reload it, as well as implementing the loading of function handles
> | in matlab files..
>
> I'm not sure why we were duplicating the data for a function directly
> in the tree_anon_fcn_handle class, so I've checked in the following
> change. Now the tree_anon_fcn_handle object just contains an
> octave_user_function object that contains the parameter list, function
> body, return list, and symbol table.
>
> The octave_fcn_handle class has an octave_value object that contains
> the function. You can extract a pointer to the user function object
> and then get the symbol table from there using the new
> octave_user_function::sym_tab method. Does that give you everything
> you need to write the load/save functions for anonymous function
> handles?
>
> Thanks,
Yes it should.. I'll look at this later this week and hope to have
load/save corrected for anonymous function handles in the octave native
formats, but equally in hdf5 and matlab formats..
D.