22 questions linked to/from How do you set attributes on SubValues?
10k views

### What is the distinction between DownValues, UpValues, SubValues, and OwnValues?

When reading through the documentation, you often encounter the phrases DownValues, UpValues, ...
4k views

### Functions vs. patterns

Every time I define a new function, I wonder which construct I should use: true functions obtained by using Function, or rule-based syntax. For example, these are ...
4k 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: ...
2k views

### Define parameterized function

I would like to be able to define the gain function of a system from its parameters. Specifically, I'd like to define a function that accepts two inputs, call them $b$ and $w$, and returns a function ...
2k views

### What are all the “magic” Symbols in the Mathematica language?

Leonid Shifrin once wrote (excerpted): (Unevaluated) is one of a very few "magic symbols", along with Sequence and ...
867 views

### Prepend 0 to sublists

My question is similar to this one, but my goal is to prepend a single 0 the each sublist, not incrementally many 0's. The file I'm working is a CSV containing around 50K sublists of length 35. I've ...
529 views

### Why doesn't a Composition[] hold its arguments and what can be done about it?

Now that Composition (also RightComposition) has shorthand syntax I am more inclined to use it, however what I feel should be ...
358 views

### Is it possible to change the order that symbol definitions are checked? (DownValues vs UpValues)

Suppose I have the function f with the following definition assigned to it: ...
361 views

### What is the difference between defining a function and specifying the type of argument, versus applying a test to that argument?

Say I want to create a function that evaluates differently based on what type of argument is given. I've found two ways of doing this, ...
808 views

### Pure functions are not functions?

According to the manual: "HoldAll is an attribute which specifies that all arguments to a function are to be maintained in an unevaluated form." The following code yields, as expected, ...
230 views

### Keywords to find documentation for this syntax

Mathematica allows this syntax, but I cannot find any documentation (or books) that discuss the various uses/advantages of it ...
296 views

### Implement settable properties

I am looking for advice on implementing the following. (It is possible that the answer is that it is simply not a good idea to do this.) I would like to have an object similar to ...
145 views

### Generating compiled functions from inactive expressions

I am working on a project in which I need to dynamically generate CompiledFunctions from Inactive expressions. For example, I ...