-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wip] Implement @sym/class to return python class name of @sym vars #561
base: master
Are you sure you want to change the base?
Conversation
it breaks most of the doctests currently. I'll update the doctests once this is finalised. |
%% Return class name of the variable x. | ||
%% | ||
%% @var{full} decides if the fully qualified class name will be returned | ||
%% or not. It it true by default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very very little thing, i think its "It its" or "Its"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops.. Thanks for pointing out, I'll fix the typo.
Hi, this is very nice!
from symfun.m line 184:
sadly we can't use the builtin function in symfun:
octave don't likes this, don't recognizes the call as the type (@symfun/symfun):
its very probable this can be a octave bug... And maybe instead of this line:
remove it and change the python cmd line to:
i think its very normal use 0 and 1 as logical values, only to enable that. Thx. Cya. |
%!error <Invalid> class (sym(1), 2) | ||
|
||
%!test | ||
%! syms x y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi its possible write instead of this line:
syms f(x, y)
?, to test sym and symfun.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohk. Or maybe we can have additional tests for symfuncs... This way, just to be sure, both can be tested separately. Will add a few more tests..
Hi @latot . Sure I'll incorporate these changes. |
I just wanted to note that I tried a few different things but as I am not able to find a decent way to make it work for both syms and symfuns...
then if I try |
|
I already report it, if you can complement the explanation it would be great: https://savannah.gnu.org/bugs/?49169 Thx. Cya. |
The idea its can overload class only to return a value, don't to set (when we will set we call builtin). |
Commented upstream, hopefully we can get some information on what Matlab does in this situation.
No, the error is in overload resolution and the extra arguments passed when doing inheritance with old-style class-based classes.
Right, classdef would work around this. |
mm, personally i think this |
I will then try to do the classdef implementation now. If that works then we could implement this on top of that. |
@genuinelucifer and @cbm755 a little question, i don't have very clear what are differences between the actual sym and implement classdef (i try search but i can get a clear answer), ex. why class should works from classdef and not now? or what the differences between the concepts vs functionalities? The mains differences i have clear are, you can set methods from classdef (but we can do this too from syms in other files), in classdef you can set properties to the objects (in some way sym do this with a struct), the extras of classdef are the events and enumeration but this last two don't are available in octave (and i was start thinking how use it :D). This can approached from other way, edit the display function and add the actual class code there. Thx. Cya. |
I'm not clear on differences either. I think of them as two different approaches to OO, or at least two different implementations. And so there are some differences between them, different bugs too ;-) Classdef-style classes allow more OO features like static methods. |
@latot where you working on the classdef? @genuinelucifer if you start too, let's get a "WIP" PR up ASAP for collaboration and not duplicating effort. |
I'm not working on it now, for i can help i need first understand the concept. Thx. Cya. |
Thanks @latot: your review if @genuinelucifer does it would be very much appreciated (and good chance to learn). |
Definitely. I am compiling octave on my linux machine. I can probably send a WIP PR by tomorrow. |
fixes issue #549
Currently it does not follow octave's builtin
class
symantics. I have kept afull
flag just for discussion.