The tag has no usage guidance.

learn more… | top users | synonyms

67
votes
5answers
5k views

What does the construct f[x_] := f[x] = … mean?

This question mentions "x := x = trickery". What does defining a function as f[x_] := f[x] = ... do and what is it good for?
104
votes
8answers
5k views

Can one identify the design patterns of Mathematica?

... or are they unnecessary in such a high-level language? I've been thinking about programming style, coding standards and the like quite a bit lately, the result of my current work on a mixed .Net/...
91
votes
7answers
10k views

Struct equivalent in Mathematica?

I really miss having something like a struct in Mathematica. I know of (and regularly use) a couple of programming techniques which feel like a ...
20
votes
2answers
1k views

How can one define a custom data object?

In Mathematica there are different objects like InterpolatingFunction or SparseArray? How can I define a custom data object with ...
5
votes
2answers
404 views

Opposite of Alternatives

I was looking at this question (here) and I tried to find any thing gives the opposite of Alternatives. In other words, some pattern matching function that gives ...
8
votes
2answers
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.
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 ...
4
votes
1answer
368 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: ...
13
votes
3answers
629 views

What's the analogue of UML in Mathematica land?

What's the analogue of Unified Modeling Language (UML) in Mathematica land? Mathematica has elements of object-orientation, but most Mathematica programs or applications aren't of object-oriented ...