octave-maintainers
[Top][All Lists]
Advanced

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

Re: Change of current context ? (whos -file ...)


From: David Bateman
Subject: Re: Change of current context ? (whos -file ...)
Date: Mon, 22 Sep 2008 21:08:32 +0200
User-agent: Thunderbird 2.0.0.16 (X11/20080725)

John W. Eaton wrote:

I understand the motivation for this approach as it would be a
relatively simple change, but maybe we should instead modify do_load
in load-save.cc to skip the call to install_loaded_variable and return
the variable names instead?  I see do_load already has a way to return
the names (the list_only option).  This change might require a little
refactoring, but maybe it would not be too difficult?


In fact this is the way I tried to do it when I added the -regexp option to the who function a few months ago. The logical way to treat this would be to move the variables.cc (class symbol_info_list) to variables.h and then use it i load-save.cc (do_load). This allows exactly the same format as with whos itself in the load function.

However, the symbol_info_list class is in fact a list of symbol_records and so there is in fact no gain in not calling install_loaded_variable to a temporary context. I suppose the proper way is to rewrite symbol_info_list to not store the symbol_record itself but only the necessary information, though that is a bit more that a little bit of refactoring.

The method I talked about doesn't let "load -l" profit from the same code, but that is an Octave extension in any case, and so probably better to use the Matlab way in any case. So in short for the minimum effort its probably better just to do it the way I suggested but include a FIXME comment discussing the issue.

Regards
David


reply via email to

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