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

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

[Octave-bug-tracker] [bug #55488] Invalid use of colon char as classdef


From: anonymous
Subject: [Octave-bug-tracker] [bug #55488] Invalid use of colon char as classdef function's argument when subsref is overwritten
Date: Wed, 16 Jan 2019 09:03:45 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.98 Chrome/71.0.3578.98 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?55488>

                 Summary: Invalid use of colon char as classdef function's
argument when subsref is overwritten
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Wed 16 Jan 2019 02:03:43 PM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: Jonas
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.2.2
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Hi

the following example fails on the strcmp line with:
error: invalid use of colon in function argument list

It doesn't fail without the subsref definition.
Any idea for a workaround?


a = Value([1,2,3,4,5])
a.get(':')




classdef Value < handle
  properties
    value
  end
  methods 
    function self = Value(val)
      self.value = val;
    end
    function varargout = subsref(self,s)
      [varargout{1:nargout}] = builtin('subsref',self,s);
    end
    function r = get(self,varargin)
      if strcmp(varargin{1},':')
        disp('hello');
      end
      r = self.value(varargin{1});
    end
  end
end


Jonas





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55488>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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