21,678 reputation
24698
bio website
location
age
visits member for 3 years
seen 2 hours ago

Frequently Asked Questions

WReach? Is that connected to WRI somehow?

The "WR" in my name has nothing to do with the company that develops Mathematica. It is just a coincidence.

Why do you start all your global variable names with $?

I use dollar signs for ad hoc global variables because I have been bitten too many times by accidentally assigning an own-value to a symbol that I happen to use, for example, in a symbolic equation. So I am in the habit of writing $x instead of x. I stick to that convention even for longer symbols like $initialUrl. Just like the regular symbol convention, Mathematica's predefined global symbols all start with a capital letter after the $. My ad hoc symbols always start with a lower case letter, so there is no conflict.

Why do you put semicolons and commas at the beginning of the line instead of at the end like a normal person?

I don't think of it that way. Rather, I switch from horizontal to vertical layout when a single expression is too long to fit on one line. This has the interesting side-effect of making the important delimiters stand out and line up. I first ran into this practice in the SQL community. SQL "programs" have the unpleasant property that they must be written as a single statement -- even if that statement is a hundred lines long (or more!). Sometimes Mathematica expressions share that property.


14h
awarded  Nice Answer
1d
comment How to filter a dataset using Select and a parameter
@GordonCoale Done.
1d
revised How to filter a dataset using Select and a parameter
by request, added mention of the prefix and postfix forms of `#[sel]`
1d
answered How to filter a dataset using Select and a parameter
Jan
24
awarded  Nice Answer
Jan
24
awarded  Nice Question
Jan
22
awarded  Nice Answer
Jan
22
revised Get the wrong result using the StringCase function and Shortest option
grammar, dammit! I'm getting old...
Jan
22
revised Get the wrong result using the StringCase function and Shortest option
grammar, spelling (sorry @bel)
Jan
22
comment Get the wrong result using the StringCase function and Shortest option
@Kuba Not the Mathematica docs, certainly. One needs to dig into the PCRE docs -- and it would probably help to put on the language-lawyer hat. :)
Jan
22
answered Get the wrong result using the StringCase function and Shortest option
Jan
22
comment Unexpected pattern matching behaviour: PatternSequence vs. Optional
I reported this issue to WRI some years ago, but never received a diagnosis.
Jan
22
comment What is the correct way to use specific rule for specific pattern match when parsing an expression?
@Mr.Wizard I added Unexpected pattern matching behaviour: PatternSequence vs. Optional.
Jan
22
asked Unexpected pattern matching behaviour: PatternSequence vs. Optional
Jan
22
awarded  dataset
Jan
22
comment Can't comment strings with '*)' inside it
+1 Clever. It exploits the fact that Mathematica is unusual among languages in that it supports nested matchfix comments (unlike, say, C).
Jan
22
answered Can't comment strings with '*)' inside it
Jan
19
comment Select From List of Nested Associations
@alancalvitti Yes, one would be. But I added it for its explanatory value in this discussion, not to enforce a restriction (and the same for _String in the second argument). We could just as well have where_String, or simply where_ if that is preferable. The core solution is insensitive to that choice.
Jan
19
awarded  Nice Answer
Jan
19
revised Select From List of Nested Associations
`MatchQ` should have been `MemberQ`