# HG changeset patch # User David Grundberg # Date 1259146069 -3600 # Node ID 11f9c592b035d1067daae72561c30c26a27619ba # Parent 2641c6febd46387f2df0c60979b47e5dc61e24dc Call user-defined subsref/subsasgn with 1xN structs instead of Nx1 diff --git a/scripts/miscellaneous/substruct.m b/scripts/miscellaneous/substruct.m --- a/scripts/miscellaneous/substruct.m +++ b/scripts/miscellaneous/substruct.m @@ -31,8 +31,8 @@ if (nargs > 1 && mod (nargs, 2) == 0) narg_pairs = nargs / 2; - typ = cell (narg_pairs, 1); - sub = cell (narg_pairs, 1); + typ = cell (1, narg_pairs); + sub = cell (1, narg_pairs); k = 1; for i = 1:2:nargs t = varargin{i}; @@ -66,11 +66,11 @@ %!test %! x(1,1).type = "()"; -%! x(2,1).type = "{}"; -%! x(3,1).type = "."; +%! x(1,2).type = "{}"; +%! x(1,3).type = "."; %! x(1,1).subs = {1,2,3}; -%! x(2,1).subs = ":"; -%! x(3,1).subs = "foo"; +%! x(1,2).subs = ":"; +%! x(1,3).subs = "foo"; %! y = substruct ("()", {1,2,3}, "{}", ":", ".", "foo"); %! assert(x,y); %!error assert(substruct); diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-11-03 David Grundberg + + * ov-class.cc (make_idx_args): Call user-defined subsref/subsasgn + with 1xN structs instead of Nx1. + 2009-09-30 John W. Eaton * error.cc (error_1, pr_where_2, handle_message): diff --git a/src/ov-class.cc b/src/ov-class.cc --- a/src/ov-class.cc +++ b/src/ov-class.cc @@ -160,8 +160,8 @@ if (len == idx.size ()) { - Cell type_field (len, 1); - Cell subs_field (len, 1); + Cell type_field (1, len); + Cell subs_field (1, len); std::list::const_iterator p = idx.begin ();