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

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

[Octave-bug-tracker] [bug #46718] Unable to create classes


From: anonymous
Subject: [Octave-bug-tracker] [bug #46718] Unable to create classes
Date: Sat, 19 Dec 2015 14:04:33 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36

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

                 Summary: Unable to create classes
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Sat 19 Dec 2015 02:04:31 PM UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Gadi Lahav
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.0.0
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Originally, I started out building a class for my own purposes, but I kept
getting the following error:


error: class: 'CComponent' is invalid as a class name in this context
error: called from
    CComponent at line 19 column 7
    test_CComponent at line 8 column 6


So I went on and tried the tutorial on the web\documentation:


function p = polynomial (a)
if (nargin == 0)
  p.poly = [0];
  p = class (p, "polynomial");
elseif (nargin == 1)
  if (strcmp (class (a), "polynomial"))
    p = a;
  elseif (isvector (a) && isreal (a))
    p.poly = a(:).';
    p = class (p, "polynomial");
  else
    error ("polynomial: expecting real vector");
  endif
else
  print_usage ();
endif
endfunction


Invoked it by simply writing

>> p = polynomial([1,0,1]);


Got the same error:

error: class: 'polynomial' is invalid as a class name in this context
error: called from
    polynomial at line 10 column 14





    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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