Tue 31 Aug 2010 06:20:53 AM UTC, comment #1:
Why do you think the assignment should go through subsasgn?
I think that a private class method should be able to access fields directly, just like non-private methods.
I checked in the following fix to address the problem:
http://hg.savannah.gnu.org/hgweb/octave/rev/f687bd17ce21
If you think it should work otherwise, please clarify and support your opinion by quoting matlab docs or showing examples.
|
Mon 30 Aug 2010 04:22:23 PM UTC, original submission:
Hello,
while trying the latest code from mercurial, I've got a problem. The class constructor calls private/df_pad.m, which fails as follows:
function df = df_pad(df, dim, n, coltype=[])
switch dim
case 1
%# complete row indexes
if isempty(df._ridx),
dummy = (1:n).';
else
dummy = vertcat(df._ridx, repmat(NA, n, size(df._ridx, 2)));
endif
df._ridx = dummy; <= fails
the code is called with an empty dataframe, dim = 1, n = 10.
Error message is
malformed class
assignement failed, or no method for 'class=matrix'
In principle, the assignement must be performed through subasgn, which it itself busy calling df_pad. The code works under 3.2.4, is there some reason while it fails under 3.3.52 ? Should I play between classes and struct to handle directly modifications of the class variable ?
The problem can be reproduced as follows:
- install the dataframe package from octave-forge
- x=dataframe('octave_frame/data_test.csv');
Regards
Pascal
|