help-octave
[Top][All Lists]
Advanced

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

Re: issue with user preferences (was "problem with column specification


From: Paul Kienzle
Subject: Re: issue with user preferences (was "problem with column specification in matrices")
Date: Fri, 1 Nov 2002 00:37:39 -0500
User-agent: Mutt/1.2.5.1i

On Thu, Oct 31, 2002 at 08:16:35PM -0600, Mike Miller wrote:
> On Thu, 31 Oct 2002, John W. Eaton wrote:
> > | Is there a way to start octave with all user preferences turned off
> > | (set to defaults)?
> >
> > But which defaults do you want?  The ones that make Octave most like
> > Matlab, or the ones that are most sensible?
> 
> I'll vote for the most sensible.

A number of people have come to octave with existing scripts written for
Matlab because they have heard that it is the most Matlab like of the
free numerical environments.  They then contribute missing functions and
patches which make Octave even more Matlab like, which serves to attract
more people who want to eliminate the remaining differences, even if the
Octave approach is more sensible.  After all, when they download 15,000 
lines of a wavelet package, do they really want to scan through every 
line to make sure that all uses of white space within [] are unambiguous?

>  Once they are set to known defaults, the
> script could then set them to whatever was needed. It would be handy for
> developing code to know that it will work the same for everyone.

The current idiom is the following:

        dfi = do_fortran_indexing;
        unwind_protect
          do_fortran_indexing = 1;
          code which requires do_fortran_indexing == 1
        unwind_protect_cleanup
          do_fortran_indexing = dfi;
        end_unwind_protect

It is kind of ugly, but it works if everyone follows the rules.  
If someone doesn't follow the rules there may be problems.  For 
example, if the code which requires do_fortran_indexing == 1 is 
a loop which evaluates a user-supplied function, and that 
function sets do_fortran_indexing = 0 for some reason, then the 
next time through the loop will fail.

This problem might be alleviated if preference flags would only
affect the current script.  The values would have to be temporarily
restored whenever another script is called, and completely
restored when the function ends.  If there were some way to
differentiate matlab-style scripts from octave-style scripts
(e.g., by calling the octave scripts .os files, or by putting the
matlab scripts on a separate load path) then the right
thing would usually happen.  However, this might raise as many
problems as it solves --- sometimes you set a preference because
of its effect on the function you are calling.

Paul Kienzle
address@hidden



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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