3
votes
2answers
136 views

Bare symbol invocation fails but not if used with an argument

How to achieve the following behavior on a symbol f? Background: The main goal is to use the symbol to tag an abstract data structure where downvalues are used to store information. Only defined ...
3
votes
3answers
107 views

Using a variable to tell Mathematica which existing variable to manipulate

I have an estimation routine I have coded up, I want now to do some tests on it where I pick a particular parameter and run the estimation for differing values of that parameter. What I want is to be ...
4
votes
2answers
109 views

Choosing an initializer list in With

I'm trying to have several initializer lists in a With function and choose which one I want to use. So far I have this: ...
1
vote
1answer
133 views

direct assignment to the element in a Table

I have already asked a related question here why set values in this way doesn't work? But I think I have to write the question which I encountered explicitly? ...
13
votes
2answers
283 views

How to make use of NumericQ[x] = True (and use it safely)?

Basic Issue: I'm trying to understand the proper use of NumericQ's "magical" capabilities. Please consider the examples below. Actual question and some links are ...
3
votes
1answer
141 views

Set promotes Rule to RuleDelayed?

In mentally building a model of how Mathematica works, I naively expected Set to create a Rule in a symbol's ...
4
votes
3answers
339 views

Delayed evaluation of assignment

I have a set of PDE's that depend on parameters. They depend on many parameters, but for simplicity we can here assume that they depend only on one, say a. I want ...
19
votes
5answers
1k views

How to pass a symbol name to a function with any of the Hold attributes?

Given a function with the attribute HoldFirst, HoldAll or similar, and a variable, list, how ...
10
votes
3answers
313 views

Why does ++++x return an increment of 2 when the value of x is only incremented by 1?

This line returns 3: x = 1; ++++x However, the value of x after the increment is only ...
8
votes
3answers
293 views

How to write a function-defining function which stores the function arguments in a stack?

I have a function-defining function SetAttributes[DefFn, HoldAll]; DefFn[f_[args___], body_] := f[args] := body; I am trying to modify this function to record ...
20
votes
1answer
571 views

How do you set attributes on SubValues?

SubValues, as discussed in a previous question, are declared as follows ...
19
votes
5answers
494 views

Reassign values to symbols

I've got a situation where I have, say 4 symbols, a, b, c and ...