Questions tagged [object-oriented]
Questions related to using or implemented object-oriented design patterns in Mathematica
35 questions
3
votes
1
answer
159
views
How to make my OOP class work inside a package?
I like to use this simple OOP setup in Mathematica that I learned from reading posts here over the years and playing around with it. This makes a Class and implement basic OOP (nothing fancy like ...
3
votes
3
answers
175
views
Can't get TagSetDelayed to match LHS when the latter has a Hold attribute set
I'm following this example here;
Code Readability and Object-Oriented Code
...
1
vote
2
answers
161
views
SummaryBox and Recursion
How can I make it so that what is under the dropdown block is not calculated/constructed at once? Example code:
...
4
votes
2
answers
280
views
How to use OOP when the object is inside a Mathematica package?
I learned how to use OOP in Mathematica as shown by Leonid Shifrin (and others in this forum over the years).
It works well, until I moved the module that represents the object to inside a package, ...
7
votes
4
answers
942
views
How to elegantly implement this one useful object-oriented feature in Mathematica?
I wrote some Mathematica code that defines a function I want to use repeatedly (f) inside another function (finit) that pre-...
3
votes
0
answers
114
views
Need to confirm bug in Dataset options before I submit report to wolfram
I need to know if I need to submit a bug report. I finally got my HeaderSize the way I want it but I had fudge it. It gives the correct widths but does this look ...
7
votes
0
answers
323
views
Mutable objects in Wolfram Language
I've seen some posts about mutable objects in WL and some implementations:
Once more on object orientation in Mathematica: does it have to be so hard?
Immutability, Association and typing
Code ...
4
votes
1
answer
163
views
Custom object display in Dataset using MakeBoxes
The below code defines a couple "objects" in the Mathematica sense using a convention consisting of so-called Q-functions for creating types and data validation, ...
0
votes
1
answer
99
views
Modified "Plus" function: how to save just the final result of an addition of multiple objects?
In my version of object-oriented programming in Mathematica, essentially (without going into details) obj[a] is a reference to an object whose actual data is stored ...
1
vote
0
answers
137
views
List of arrays in Mathematica
How would I declare a list of arrays and treat them as single objects? For example, I may have the Pauli matrices:
$$
\sigma_0 = \begin{bmatrix}1 & 0 \\ 0 & 1\end{bmatrix}, \sigma_1 = \begin{...
8
votes
2
answers
311
views
Weighted graph with multiple different coloured non-weighted paths - styling
This follows on from my previous question answered here.
Ultimately, I now have a graph which I've simplified for posting here:
...
2
votes
1
answer
385
views
Convenient value assignments in OOP
It is possible to implement OOP in Mathematica using something like
obj=c[<|a->1,b->2|>]
and it's convenient to extract value from the object by ...
24
votes
2
answers
454
views
Implementing a chat system in Mathematica
My friends and I don't want to use Slack or Gitter, but instead a pure-Mathematica chat system.
Now that the ChannelFramework exists, how could we do this?
4
votes
0
answers
121
views
What can the *MutationHandler* functions do? [duplicate]
So in this answer we see the only use I know of of the function Language`SetMutationHandler.
And just to see what it could do I tried it on one version of my OOP ...
7
votes
3
answers
300
views
How to disallow the application of functions outside a white list?
In an earlier post I described a special kind of list (actually, a special kind of multiset) that can be represented more efficiently with a structure like this:
...