octave-maintainers
[Top][All Lists]
Advanced

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

GSoC Code Sharing - weboptions


From: Kai Torben Ohlhus
Subject: GSoC Code Sharing - weboptions
Date: Mon, 16 Jul 2018 13:33:49 +0200

Dear Sahil,

I've just seen your commit [1], where you added setters for the weboptions class.  In my opinion this happened in a very complicated way.  There is a "cleaner" syntax to define setters in classdef classes, that is working in Octave 4.4.0.  For example:

classdef myClass < handle
  properties
    A
  endproperties
  methods
    function set.A (obj, val)
      if (val > 0)
        obj.A = val;
      else
        error ("Serious?");
      endif
    endfunction
  endmethods
endclassdef

There is to admit, that the classdef documentation in Octave has potential for improvement. Thus it might sometimes be beneficial to sneak at Matlab [2], to get an idea how it will once be working in Octave. A similar example can be found in [3].

Best,
Kai

[1] https://bitbucket.org/me_ydv_5/octave/commits/abbc8f5c151b437848a9530f5c17f555f609bdcb
[2] https://www.mathworks.com/help/matlab/matlab_oop/property-set-methods.html
[3] https://github.com/vsdp/vsdp-2018/blob/master/vsdp_options.m

reply via email to

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