154k 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 ...
17k 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 ...
6k views

### Does Mathematica have advanced indexing?

I have two $M \times K$ arrays $L, T$ where I would like to set all the elements in $L$ to zero whenever the corresponding element of $T$ is greater than 15. The ...
9k 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 ...
3k views

### Pure Functions with Lists as arguments

Assuming I have two function: example 1: add[{x_, y_, z_}] := x + y - z add[{1, 3, 5}] If use pure function,I know I can write it as : ...
2k views

### Lexicographic ordering of strings in Mathematica

I recently realized that Mathematica seems incapable of comparing strings in the "normal" expected lexicographic order. Indeed, for some simulations, I need to process text directly, without fiddling ...
2k views

### Is there anything like a C pointer (or returning a reference) in $Mathematica$?

I want to do in Mathematica what the following does in C. ...
289 views

### Error Using Sow in DensityHistogram with ColorFunction

To find the color values used in a plot, I was using Sow as shown here: ...
231 views

### Map Input A B C to MyProduct[A,B,C] (NOT to Times[A,B,C])

In writing my own (noncommutative) product I want to avoid typing redundant symbols like A.B.C or A**B**C, I just want to type <...
181 views

### Recommendations about modifying usage of built-in symbols

In my package, I use some of the built-in Mathematica symbols in non-canonical ways. Right now, I use them as Options or ...
123 views

### How to put the result(and its specified variable) to clipboard

I have a such custom function to do some complicated thing: customFun[str_] := Defer[StringJoin["abc",ToString[#]]&@*StringLength][StringDrop[str,{1,-1,2}]] ...