Linked Questions

602 votes
19 answers
156k views

Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
139 votes
8 answers
9k 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/...
Verbeia's user avatar
  • 34.2k
160 votes
3 answers
13k views

How to make use of Associations?

I have been curious about it for long. Now that Mathematica 10 arrives, I think it's time to ask the question: How the new Association data structure would be used ...
Yi Wang's user avatar
  • 7,347
52 votes
3 answers
6k views

Changing Values in an Association using Map

I am trying to change the value of one key in an association based on the value of another key in that association. So if my association starts as: ...
Jon F.'s user avatar
  • 645
29 votes
1 answer
2k views

Is it possible to reference "self" from a pure function?

This would calculate the factorial of 6, if the "self" was the function itself. Is there something that could allow this? ...
user's user avatar
  • 1,877
24 votes
1 answer
842 views

Why does the documentation call functions "pure"?

Clearly, Functions in mathematica are not pure functions according to the definition on Wikipedia (no side effects - basically implementabe with table lookups) the ...
masterxilo's user avatar
  • 5,739
18 votes
2 answers
526 views

Garbage collection for lexical closures

Mathematica is known not to garbage collect temporary variables in certain cases. I am particularly interested in the very useful programming pattern known as a lexical closure. A somewhat trivial ...
user293787's user avatar
  • 11.8k
8 votes
2 answers
4k views

How to convert a string of number into real numbers without precision loss

I searched and did not find similar answers which can resolve the 'no precision loss' issue. A sample string is: ...
LCFactorization's user avatar
1 vote
1 answer
168 views

Constructing a List of Functions

I would like to construct a list of Functions that can be used like: F[z][[i]] Where one can choose between list elements with ...
CR36's user avatar
  • 127
7 votes
0 answers
109 views

Time complexity to choose the right overload from the memoized function

If we want to save some outputs of the function, we often use the memoization pattern as follows, f[x_]:=f[x]=x f/@Range[10^5] If I call this function many times ...
Sungmin's user avatar
  • 2,295