3

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.

user13517
  • 31
  • 1
  • See here for some discussion, links, and references. – ciao Apr 29 '14 at 08:07
  • 1
    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. – Oleksandr R. Apr 29 '14 at 12:49
  • 1
    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. – Leonid Shifrin Apr 29 '14 at 15:57

0 Answers0