Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options answers only user 12

How to manipulate expressions structurally, not necessarily complying with the rules of algebra.

6
votes
This is not about parsing, it's about evaluation. Consider f[Sequence[1,2]] which evaluates to f[1,2], and compare with f[#]&[Sequence[1,2]] which first evaluates to f[#]&[1,2] then to f[1 …
answered Feb 11 by Szabolcs
5
votes
The reason for this behaviour is that Module does localization by renaming. For example: Module[{x}, x] (* x$982 *) That x inside Module is renamed to something like x$nnn with nnn being a differe …
answered Aug 17 '14 by Szabolcs
8
votes
expr = K == 2.7536 || K == 4.6917 || K == 6.3913 || K == 8.3237 K /. {ToRules[expr]} Be aware that K is a built-in symbol and avoid assigning values to it (otherwise obscure things will get broken) …
answered Oct 3 '17 by Szabolcs
12
votes
For arbitrarily nested heads I would use recursion and pattern matching, like this: ClearAll[replaceFirstHead] replaceFirstHead[head_[body___], newHead_] := replaceFirstHead[head, newHead][body] repl …
answered Oct 27 '15 by Szabolcs
4
votes
There are multiple ways. You can return Nothing instead of the default Null. polynomials = Table[ If[i + k == 6 && j + l == 4, Subscript[p, i, j]*Subscript[p, k, l], Nothing …
answered Nov 16 '16 by Szabolcs
4
votes
There's no single BoundedQ function that I know of, but there are several related functions: FunctionRange tries to compute the range of a function: range = FunctionRange[1/x, x, y] (* y < 0 || y > …
answered Jul 20 '15 by Szabolcs
2
votes
@corey gave the obvious answer in the comments. That is the way I would usually use. If you are completely new to programming, I recommend: https://www.wolfram.com/language/elementary-introduction …
answered Dec 15 '16 by Szabolcs
16
votes
I think this is the simplest fast way to convert an atomic expression to an equivalent compound form, to be able to inspect and manipulate its "apparent" full form: g = RandomGraph[{5,8}]; (* this is …
answered Oct 18 '15 by Szabolcs
5
votes
This is indeed somewhat confusing when you are new to Mathematica. In Mathematica, == stands for mathematical equality. Thus a == 0 does not evaluate to either True or to False until a is replaced b …
answered Jul 30 '15 by Szabolcs
4
votes
In a practical scenario, you may be storing your expression in a variable. To be able to do so, it must be held unevaluated. expr = Hold[Plot[x, {x, 0, 1}]] (* Hold[Plot[x, {x, 0, 1}]] *) Then you …
answered Oct 12 '17 by Szabolcs
20
votes
I'm going to take this as a general question, referring to all atomic objects, not just DelaunayMesh. By design, atomic objects like DelaunayMesh, SparseArray, Graph, etc. or even Association and Rat …
answered Oct 9 '15 by Szabolcs
8
votes
This is related to the Orderless attribute of Times and Plus. These attributes could be removed permanently with some hacks, but that would break Mathematica. If you only want to display the result …
answered Jan 30 '16 by Szabolcs
6
votes
No, this is not possible. A cell can only be evaluated if it contains a complete and syntactically correct expression. You might want to try Code style cells (Alt-8 or Command-8) which contain plain …
answered Apr 15 '14 by Szabolcs