octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #32344] syntax difference between 3.2.3 and 3.


From: Pascal Dupuis
Subject: [Octave-bug-tracker] [bug #32344] syntax difference between 3.2.3 and 3.5+ -- should be documented
Date: Thu, 03 Feb 2011 22:02:46 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13

URL:
  <http://savannah.gnu.org/bugs/?32344>

                 Summary: syntax difference between 3.2.3 and 3.5+ -- should
be documented
                 Project: GNU Octave
            Submitted by: cdemills
            Submitted on: jeu 03 fév 2011 22:02:43 GMT
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Pascal Dupuis
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.2.3
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Consider the following code snippet, with 3 functions defined in the same
file:

function x = changes(y)

if 0 == nargin, y = []; endif

a = int16(18);
x = innerfunc(a+y);

%# endfunction : OK with 3.2.3 -- NOK with 3.5.0+

function z = innerfunc(u)

z = u+otherfunc(u);

endfunction

function u = otherfunc(v)
u = log2(double(v));

endfunction


-under 3.2.3, 'changes(0)' produces 22 as result;
-under 3.5+, the same call results in the error:
parse error near line 21 of file changes.m
  inconsistent function endings -- if one function is explicitly ended, so
must all the others
warning: nested functions are coerced into subfunctions in file changes.m
error: parse error while reading function file changes.m

The comment at line 8 must be removed in order for the code to run under
3.5+, delivering 22 as result too. This stricter requirement about functions
ending should be documented in the upcoming 3.4 release.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?32344>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.gnu.org/




reply via email to

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