Reputation
689
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
3 13
Impact
~6k people reached

Apr
25
awarded  Nice Question
Feb
16
awarded  Yearling
Dec
21
comment How to make use of Associations?
@Leonid Shifrin: I like your method, a natural approach to make use of the private and public variables. Thanks.
Dec
21
comment How to make use of Associations?
@Leonid Shifrin: A working fix is to replace "lastName" -> "Shifrin" with "n" -> 0, "lastName" :> If[self["n"] == 0, "Shifrin", self["lastName"]], and add ++self["n"] to the definitions for "setField" and "fullName". But I think there should be more elegant and general solution than this.
Dec
21
comment How to make use of Associations?
@Leonid Shifrin: There is an unnoticed bug in your code "II.3. Combining Associations and mutability". The variable self$___ updates itself, however, the variable pinfoSM remains un-updated, such that pinfoSM["lastName"] still gives Shifrin after we update self$___. A manual pinfoSM = self$___ will fix this. I wonder if there is an automatic approach?
Jun
4
awarded  Nice Question
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