The tag has no wiki summary.

learn more… | top users | synonyms (1)

46
votes
2answers
2k views

Once more on object orientation in Mathematica: does it have to be so hard?

Recently I came across a set of problems which would be solved most easily within an object-oriented approach. I first attempted to solve them by other means, but found the complexity of the code ...
21
votes
2answers
1k views

Code Readability and Object-Oriented Code

The basic problem I have been running into is making readable code, where in other languages I am more familiar with I might have been using class or struct like objects. For example, you can imagine ...
7
votes
1answer
2k views

How can I implement object oriented programming in Mathematica?

Roman Maeder's object oriented programming package is nice, but I'm hoping someone can suggest a sleek and novel implementation that is easy to use.
5
votes
0answers
94 views

Modify NDSolve`StateData (if possible)

I am trying to solve a PDE that needs to be scaled constantly (refer to this). @andre suggests I modify NDSolve`StateData. Now, the problem is, I'm not used to ...
4
votes
3answers
203 views

How to combine Date and Time objects into DateTime object?

Considering a DateObject d and TimeObject t: ...
3
votes
1answer
158 views

Inheritance in Mathematica using pattern matching on UpValues

Edit: I think in my original post, I missed emphasizing the main point. This is mainly a pattern matching question. If you're interested in the 'why' of this question, please read the original post ...
3
votes
1answer
328 views

Do “objects” in Mathematica have to be declared?

A while ago I learned a trick which allows one to imitate object-oriented programming in MMA using SubValues: ...
3
votes
0answers
59 views

how implement OOP [duplicate]

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 ...
1
vote
1answer
98 views

Experiment with TagSetDelayed involving Part

Reading Associating Definitions With Different Symbols, I was intrigued by this: You can think of upvalues as a way to implement certain aspects of object-oriented programming. A symbol like ...
1
vote
0answers
58 views

Custom Head for Encapsulation

Often when I'm writing a project in Mathematica, the number of arguments I must provide to functions spins out of control. I need a sort of object-oriented encapsulation approach. I've already had a ...
1
vote
0answers
35 views

How to implement a set method? [duplicate]

I'm trying to program using object orientation in Mathematica. For this i need to implement get and set methods. Lets consider that we are working with a person class, that have the fields name and ...