[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #59126] max_recursion_depth exceeded when call
From: |
Fernando |
Subject: |
[Octave-bug-tracker] [bug #59126] max_recursion_depth exceeded when calling builtin 'end' from redefined 'end' |
Date: |
Thu, 17 Sep 2020 20:08:15 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0 |
URL:
<https://savannah.gnu.org/bugs/?59126>
Summary: max_recursion_depth exceeded when calling builtin
'end' from redefined 'end'
Project: GNU Octave
Submitted by: tutissanalio
Submitted on: vie 18 sep 2020 00:08:13 UTC
Category: Interpreter
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Unexpected Error or Warning
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Release: 6.0.90
Discussion Lock: Any
Operating System: Any
_______________________________________________________
Details:
I defined the following class, which redefines the END method to print a
message:
classdef classend < handle
properties
data
end
methods
function obj = classend(data)
obj.data = data;
end
function r = end(obj,k,n)
fprintf('''end'' called with index=%d of %d\n',k,n);
r = builtin('end',obj,k,n);
end
end
end
then I get the following error when using END:
octave:1> obj=classend(1:5)
obj =
classend object with properties:
data: [1x5 double]
octave:2> obj(end)
'end' called with index=1 of 1
'end' called with index=1 of 1
'end' called with index=1 of 1
... (deleted lines) ...
'end' called with index=1 of 1
'end' called with index=1 of 1
error: max_recursion_depth exceeded
error: called from
end
end at line 11 column 9
Instead of that, the result should have been (like in Matlab):
octave:2> obj(end)
'end' called with index=1 of 1
ans =
classend object with properties:
data: [1x5 double]
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?59126>
_______________________________________________
Mensaje enviado vía Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #59126] max_recursion_depth exceeded when calling builtin 'end' from redefined 'end',
Fernando <=