Reputation
629
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
2 11
Newest
 Yearling
Impact
~5k people reached

May
22
accepted Built-in symbols that support operator form
May
22
comment Built-in symbols that support operator form
@Mr.Wizard As always I learn useful knowledge from you, concise yet rich when digested. Thank you for your attention.
May
22
comment Built-in symbols that support operator form
@Michael E2 Brilliant! We let Mathematica examine its own documentation as external sources and search for the key word. I would have considered using python for this, but your alternative script is even better, because it shows the potential to use Wolfram Language to do big things in scientific computing, which for now is still domanined by python together with C++. The first answer clearly attributes to you, while the improved answer from Mr.Wizard can offer better performance and accuracy. For this reason I mark Mr.Wizard's answer as the best answer, but you have my sincere thanks.
May
21
comment Built-in symbols that support operator form
@Mr.Wizard, I will be glad to know any possible method that can do this. However I am also glad to know that this is not feasible by using the Wolfram Language alone without help from "external intelligence" (i.e., manual check). In fact the latter case would be a good example for the Godel's incomplete theorem, which states that any consistent system that is general enough to include elementary arithmetic is not complete. I.e., there are always true statements not provable from within such consistent system. To prove these statements we need "external intelligence" outside from the system.
May
21
asked Built-in symbols that support operator form
May
9
comment Built-in symbols which are more close to the root/core of Wolfram Language
@ jkuczm, I see what you mean. When making assignments (with six operators: Set, SetDelayed, TagSet, TagSetDelayed, UpSet and UpSetDelayed), the head then all arguments of lhs are completely evaluated, but the applying of any existing rule for the last step to completely evaluate the partly evaluated lhs (using first UpValues, then DownValues and finally SubValues) is avoided. Thank you for your comments, now my understanding of the evaluation process is strengthened.
May
8
asked Built-in symbols which are more close to the root/core of Wolfram Language
Apr
27
revised Why the flat f[x] is treated as ghostHead_[f[x]]?
added 1328 characters in body
Apr
27
revised Why the flat f[x] is treated as ghostHead_[f[x]]?
added 1328 characters in body
Apr
27
comment Why the flat f[x] is treated as ghostHead_[f[x]]?
@Szabolcs Thank you for the insight! This explains everything, since the output is wrapped as StandardForm@G[2,e] and the UpValues of G is applied. This side effect is not intended but we may be able to make use of it. You have my gratitude for helping me understand this.
Apr
26
comment Why the flat f[x] is treated as ghostHead_[f[x]]?
The mystery is where does the wrapper come from. It is almost certain that it is introduced by the Front End, but how and why? If we change the outermost head h_ to some certain symbol h, ie, h[a___, G[x_, ___, y_], b___] ^:= (Print@Hold@h[a, G[x, y], b]; y[x]) then the previous result e[2] is not obtained. This shows that the Front End picks the ghostHead it wraps to G[2,e]. There must be some mechanism used by the Front End, but the purpose is hidden.
Apr
26
revised Why the flat f[x] is treated as ghostHead_[f[x]]?
added 193 characters in body
Apr
26
asked Why the flat f[x] is treated as ghostHead_[f[x]]?
Feb
16
awarded  Yearling
Jul
15
comment How can I define a 3D version of the built-in VoronoiDiagram (VoronoiMesh in V10) function?
The free package Voro++ does all the tricks, but it is in C++. This package is used in LAMMPS (Large-scale Atomic/Molecular Massively Parallel Simulator) math.lbl.gov/voro++
Jul
2
awarded  Curious
Jun
23
comment How can I create a function with optional arguments and options?
@AndyRoss, as to your nr = x_/;!OptionQ[x], according to The Standard Evaluation Procedure, in f[x_,y:nr:2,z:nr:3,OptionsPattern[]]:=..., the patterns x_,y:nr:2,z:nr:3,OptionsPattern[] will firstly be evaluated in order. If any of the y or z Condition fails then the entire definition of f will be considered unmatched and the follwing SetDelayed will not be applied. As a result, if we call f[1,"g"->(#^2&)] then the "g"->(#^2&) will firstly be checked with the y:nr:2 which yields unmatch.
May
28
comment Extracting graphics primitives from a Graphics expression with ReplaceAll
Throw, Catch, Sow, and Reap can be used almost anywhere in any code, such powerful attribute might also be heavily used in the built-in code of Trace, and I think they are at very fundamental level of Mathematica language.
May
28
comment Extracting graphics primitives from a Graphics expression with ReplaceAll
Concise and enlightening, you have my gratitude!
May
28
accepted Extracting graphics primitives from a Graphics expression with ReplaceAll