Just recently I noticed that the arithmetic operators don't seem to work as expected as well, with the error message "Non numeric value("45.154") used in arithmetic operation", where the value belongs to the argument of the operation (not the receiver). May I assume the fix will also cater for that problem?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Rick, I would expect the result of an arithmetic operator on 2 objects of a the same subclass of string to be an object of the subclass rather than an object of superclass (i.e. the string class) as is shown by the attached code sample. What do you think?
Not unless you override the method and implement it that way yourself. The
docs specifically say it returns a string object. And this is NOT going to
be implemented, as it has some major performance considerations.
Rick, I would expect the result of an arithmetic operator on 2 objects of
a the same subclass of string to be an object of the subclass rather than
an object of superclass (i.e. the string class) as is shown by the attached
code sample. What do you think?
Rick a while back you're were asking (I believe) what I wanted to do. The attached code is a sample of what I intended. With one of the the latest builds from build.oorexx.org this works as I want it to work, with subclassed arithmetic operators as discussed.
Committed [r9427]
Related
Commit: [r9427]
Just recently I noticed that the arithmetic operators don't seem to work as expected as well, with the error message "Non numeric value("45.154") used in arithmetic operation", where the value belongs to the argument of the operation (not the receiver). May I assume the fix will also cater for that problem?
Not sure I understand what you are doing. Please provide a sample program illustrating the error.
Ok, will do that tomorrow, it's "sleepy sleepy time now".
Committed new fix [r9543]. Somehow the original fix got lost.
Related
Commit: [r9543]
Sample program attached.
This appears to fix this problem too.
Great, thanks Rick.
Rick, I would expect the result of an arithmetic operator on 2 objects of a the same subclass of string to be an object of the subclass rather than an object of superclass (i.e. the string class) as is shown by the attached code sample. What do you think?
Not unless you override the method and implement it that way yourself. The
docs specifically say it returns a string object. And this is NOT going to
be implemented, as it has some major performance considerations.
Rick
On Tue, Nov 26, 2013 at 5:07 AM, Ruurd Idenburg idenburg@users.sf.netwrote:
I guess I figured that more or less, it's a pity but understandable, with strings being the building blocks.
Rick a while back you're were asking (I believe) what I wanted to do. The attached code is a sample of what I intended. With one of the the latest builds from build.oorexx.org this works as I want it to work, with subclassed arithmetic operators as discussed.