yamlmatlab icon indicating copy to clipboard operation
yamlmatlab copied to clipboard

uncommented comments and invalid imports in class def in the file DataTime.m

Open babaq opened this issue 9 years ago • 2 comments

just found that the file license header is not properly commented, and lots of

import yaml.*

before every function defined in the DataTime class.

i am not sure this kinds of import is valid, but my Matlab R2016a complaints that this is not the valid syntax, may be it should be moved into the function definition.

babaq avatar Jun 21 '16 19:06 babaq

I suspect that you are getting errors because the package is not on your path?

apassy avatar Aug 01 '17 17:08 apassy

I had the same issue, solved it by adding the implementation of doFun:

    methods (Access = private)
        function this = doFun (this,o, val)
            import yaml.*;
            if isa(val,'DateTime') && isa(this,'DateTime')
                this.serialDate=o(this.serialDate, val.serialDate);
            elseif isa(val,'DateTime') && not(isa(this,'DateTime'))
                val.serialDate=o(this, val.serialDate);
                this = val;
            elseif not(isa(val,'DateTime')) && (isa(this,'DateTime'))
                this.serialDate=o(this.serialDate, val);
            else
                this.serialDate=DateTime(o(this, val));
            end
        end
        
        
    end
    
end

Code is I think from here: https://github.com/ziyuw/rembo/blob/master/src/utils/yamlmatlab/DateTime.m

cheristi avatar Aug 09 '18 07:08 cheristi