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

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

[Octave-bug-tracker] [bug #48031] command syntax fails when a local vari


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #48031] command syntax fails when a local variable in another scope shadows command
Date: Thu, 26 May 2016 17:07:01 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0

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

                 Summary: command syntax fails when a local variable in
another scope shadows command
                 Project: GNU Octave
            Submitted by: mtmiller
            Submitted on: Thu 26 May 2016 10:06:59 AM PDT
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

This was reported on irc with the MIRToolbox
(https://www.jyu.fi/hum/laitokset/musiikki/en/research/coe/materials/mirtoolbox/Download).

The following minimal reproducer throws the error for me:


#### myplot.m ####

function myplot (ax)
  if (isempty (ax))
    figure ();
  endif

  plot (1:10);
  hold on
  axis tight
endfunction

#### @myclass/myclass.m ####

function y = myclass ()
  y = class (struct (), "myclass");
endfunction

#### @myclass/plot.m ####

function plot (x)
  axis = [];
  myplot (axis);
endfunction



The error is the same as if "axis" were a variable in the current scope, it
appears as a "parser error" on the function that is called with command
syntax.


parse error near line 8 of file /path/to/myplot.m

  syntax error

>>>   axis tight
                ^

error: called from
    plot at line 3 column 3






    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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