184 views

### Local variables whose definitions depend on each other [duplicate]

Consider the following (pseudo-)function definition: f[l_] := Let[{ a = Length[l], b = First[l], c = b/a, }, c*10] So for ...
104 views

### Is there any way to implement a “sequential” With[] in Mathematica? [duplicate]

I want the equivalent of Scheme's let*, or basically, a sequential With that works like this: ...
157 views

### Reuse local variable in declaration within With [duplicate]

Considering the richness of Mathematica.SE, I am quite surprised I could not find my answer... I am very sorry if it is a duplicate. Consider the following example: ...
68 views

### What's the best practice for nested local constants? [duplicate]

Possible Duplicate: How to avoid nested With[]? I have many situations where I have a constant that is local to a function, with other constants that are computed from it. I see that I can ...
93k 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 ...
5k views

### Metaprogramming in Mathematica

Being functional, and having no "quotation", i.e. essentially treating data and programs semantically same, Mathematica seems naturally capable of doing metaprogramming. But could anyone construct a ...
5k 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 ...
1k views

### How do you programatically load data into symbols?

I am trying to convert a list of string names into symbols, which will then be used to store data. I have 24 files (where the name of each file is a member of the list mentioned above) that I need to ...
1k views

### How to match a pattern with a pattern?

UPDATED This question is about: "What is the pattern to match a pattern-definition, exactly as it is written?" My original question is now split according to Mr.Wizards insightful answer below. This ...
511 views

### Generating assignments and transforming code inside Holding forms when generating code

I have been playing with slightly above trivial code manipulations in Mathematica. I thought Mathematica would be great for this kind of work because of rule replacement and expression manipulation, ...
275 views

### Clean and handy Options management/filtering

the case I want to be able to create a function with some default options but also without need to add full explicit list of options available for it. And then inside I want to be able to filter ...
742 views

### A debug utility to print or extract intermediate data from a program

Is there a way to print variables using their names, or to extract the corresponding information for later analysis ?
421 views

### Removing calls to MainEvalute when using inlined compiled closures

This question is tightly related to the answer Shaving the last 50 ms off NMinimize. There @OleksandR shows how inlined closures can be used to eliminate calls to ...
Bug introduced in 8.0.4 or earlier and persists through 10.4. I am trying to evaluate this integral numerically $$\int_0^{\infty } J_0(q R) \tanh(q) \, \mathrm{d}q$$ for large values of $R$. ...