Bug in the if test
Jaroslav Hajek
highegg at gmail.com
Wed Aug 20 01:21:00 CDT 2008
On Tue, Aug 19, 2008 at 8:09 PM, John W. Eaton <jwe at bevo.che.wisc.edu> wrote:
> On 18-Aug-2008, Jaroslav Hajek wrote:
>
> | On Tue, Aug 12, 2008 at 11:07 AM, Zdenek Wagner
> | <wagner at hroch486.icpf.cas.cz> wrote:
> | > To: bug at octave.org
> | > Cc: zdenek.wagner at gmail.com
> | > Subject: Bug in the if test
> | >
> | > Bug report for Octave 3.0.1 configured for i386-redhat-linux-gnu
> | >
> | > Description:
> | > -----------
> | >
> | > * I have the following code in order to make the same program work in several
> | > versions of Octave:
> | >
> | > if exist("save_precision") == 5
> | > oldprec = save_precision(newprec);
> | > else
> | > oldprec = save_precision;
> | > save_precision = newprec;
> | > endif
> | >
> | > Yet Octave emits warning that save_precision is no longer a builtin variable
> | > although exist("save_precision") does return 5.
> | >
> | > Repeat-By:
> | > ---------
> | >
> | > The code is inside a function written by me. The bug occurs both when called
> | > interactivelly and when invoked from a script started by
> | > octave -qH script.m
> | >
> | > Fix:
> | > ---
> | >
> |
> | Currently, the check is made at parse time. The attached patch
> | postpones it until first actual execution of the statement (but only
> | warns once).
>
> I applied this change to my sources.
>
I transplanted it to 3.0.x
regards
--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
More information about the Bug-octave
mailing list