I have a task implement OOP in wolfram mathematica. I think write class Point and inherit from it class Rectangle. In C# or C++ it's very easy, but I don't know how do it in wolfram mathematica. All books which I found I must pay for them. Can you advise some free books, or give examples how write and work wit classes. Tnanks,Maria.
$\begingroup$
$\endgroup$
3
-
$\begingroup$ See here for some discussion, links, and references. $\endgroup$– ciaoApr 29, 2014 at 8:07
-
1$\begingroup$ Just bear in mind that you might be letting yourself in for more than you expect. It's not just about how to write a class. First you have to write the entire OOP implementation, because Mathematica is not an object-oriented language. It can be done, but going down the OOP route might not be the easiest way to attain your goals, whatever they might be. $\endgroup$– Oleksandr R.Apr 29, 2014 at 12:49
-
1$\begingroup$ I have implemented a version of OOP which I described here. In that post, I explained how it works and added a few examples you may find useful. My implementation is somewhat similar to Maeder's (although I did this independently, not based on his code), but IMO I have more idiomatic method calls, which allow usual Mathematica patterns and method overloading. OTOH, class field support currently is suboptimal, something I have to work on. $\endgroup$– Leonid ShifrinApr 29, 2014 at 15:57
Add a comment
|