[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #52582] using static method to initialize prop
From: |
avlas |
Subject: |
[Octave-bug-tracker] [bug #52582] using static method to initialize property value fails |
Date: |
Wed, 24 Apr 2019 16:53:07 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/73.0.3683.86 Chrome/73.0.3683.86 Safari/537.36 |
Follow-up Comment #18, bug #52582 (project octave):
I don't get seg fault, I guess sth related to this has changed between 5.1 and
Dev.
Thanks for the workaround, but isn't it a bit strange having to move the
function outside the class?
At the moment I use this alternative version that seems to work both in Matlab
and Octave (not using Constant properties neither Static methods):
classdef testL2
properties
engine
isMatlab
end
methods
function obj = testL2()
obj.isMatlab = f_isMatlab(obj);
if obj.isMatlab
obj.engine = 'matlab';
else
obj.engine = 'octave';
end
end
function bool = f_isMatlab(obj)
LIC = license('inuse');
bool = strcmp(LIC.feature,'matlab');
end
end
end
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?52582>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/