Linked Questions
16 questions linked to/from Do people actually use UpValues?
5 votes
2 answers
687 views
What is the point of tagset /:? [duplicate]
I'm teaching myself Mathematica and came across tagset. So I followed the example in the link, but seem to be missing the point. All of the below give me the same answer after assignment: that ...
608 votes
19 answers
161k 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 ...
124 votes
7 answers
19k 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 ...
224 votes
2 answers
15k views
What is the distinction between DownValues, UpValues, SubValues, and OwnValues?
When reading through the documentation, you often encounter the phrases DownValues, UpValues, ...
123 votes
1 answer
8k views
File-backed lists/variables for handling large data
Background Currently I am working with some large data (most of it generated by Mathematica itself). I usually find it a hassle to do this. For example, I just exported a large amount of data to ...
17 votes
2 answers
3k views
How was Nothing implemented?
How was Nothing implemented in Wolfram language at the language level? For example, {a, b, Nothing, c, d, Nothing} will return <...
28 votes
1 answer
2k views
UpValues, TagSet and UpSet, what's the difference, when should you use them?
Some of the big mysteries of Universe Mathematica for me is the application of UpValues. I know about this question and know the very poor Mathematica documentation on that. I'm very curious to know ...
5 votes
2 answers
522 views
Comparing LetL and Module efficiency
I was recently introduced to the LetL macro thanks to Leonid's answer to one of my prior questions. I was, needless to say, impressed by the simplicity of its ...
6 votes
2 answers
141 views
Assert no unevaluated function applications
Background Suppose I have begun a fresh kernel session, and I have defined the following function alone: F[x_, y_] := x + y; One expected use of ...
8 votes
3 answers
293 views
Defining a custom Plus for a specific class of arguments
I'm trying to develop an domain-specific language with Mathematica. I want to define a customized behavior for the Plus function when applied to my data. For ...
2 votes
1 answer
322 views
Replacing product of functions wih another function
I have a function which depends on w,x,y,z. Let me call ...
3 votes
1 answer
229 views
Unprotect fails the first time, works on second pass [duplicate]
I am redefining some of the standard math functions. I know this is dangerous, so I am trying to be extra careful. (For instance, in the redefinitions, I make sure to only match a custom head) The ...
4 votes
1 answer
168 views
Can UpValues (as well as other "*Values") always be converted to DownValues?
As this post has discussed, UpValues are certainly useful, and as this post has discussed, g /: f[g[x_]] := h[x] is not ...
1 vote
0 answers
239 views
Understanding TagSetDelayed
I was reading What is the distinction between DownValues, UpValues, SubValues, and OwnValues? and I started to be confused with the part "Upvalues" of the first answer. Some of my confusion comes ...
1 vote
0 answers
158 views
How does this `Tagset` /: defined function work?
This came up in an assignment problem. I am tasked to use 1) ▽ /: ▽[f_] := {D[f, x], D[f, y], D[f, z]} 2) ...
0 votes
1 answer
130 views
Symbolic re-assignment of products
Suppose I have some symbolic tensors $X,Y$ and I want to assign X.Y into something else without specifying what $Y$ is. For example, I may want $Y$ to serve as ...