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

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

[Octave-bug-tracker] [bug #60861] set command doesn't allow mixed prop/v


From: anonymous
Subject: [Octave-bug-tracker] [bug #60861] set command doesn't allow mixed prop/value pairs and cell arrays
Date: Wed, 21 Jul 2021 04:37:17 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36

Follow-up Comment #2, bug #60861 (project octave):

[comment #1 comment #1:]
> I believe the issue is that Octave expects either 1) property/value pairs,
2) cell array of properties, cell array of values, or 3) a struct array.  Try
`help set`
>

I realize that for simplicity, Octave will often forsake Matlab compatibly for
simplicity but in this case it would almost trivial to code the set command so
that it was compatible with Matlab. For example, the set command could be
written as follows:
 

function r = set(varargin)
  h = varargin{1}
  for k = 2:2:length(varargin)
     sett(h,varargin{k},varargin{k+1});
  end;

 
In this example "set" is the new set command and "sett" is Octave's current
implementation of the set command. Of course the best implementation would
probably not look like that for efficiency reasons, but this implementation
shows that full matlab compatibility for the set command is not far away.

~Paul



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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