Reputation
65,463
Next tag badge:
207/100 score
19/20 answers
Badges
6 194 285
Newest
 Nice Answer
Impact
~408k people reached

1d
comment Find and return the key with lowest value in association list
+1. I think, you should definitely keep it.
2d
comment Metaprogramming in Mathematica
@ciao Thanks, I've just received your bounty :). But I feel uneasy about this, still. You know, I am ready to return back several times as many points, if that would help keep you on the site. We've all been through the frustration regarding the inadequacy of rep. My own take is that since some point, I started to simply ignore rep. The fact is, this site has a ton of quality answers, and people like us move it forward to make even better. I believe that we have what matters the most: strong, nice and active community, and tons of really useful stuff exposed already or waiting to be exposed.
Apr
23
comment Metaprogramming in Mathematica
@ciao And thanks for your intent regarding a very generous bounty! But as I said, I would personally much appreciate you staying in the community (if possible of course), and many others surely would also.
Apr
23
comment Metaprogramming in Mathematica
@ciao Glad to hear that! By the way, may I ask why you decided to leave this community (if that is so)? Your contributions and participation here are very valuable. It would be a great pity if you leave.
Apr
22
comment Partial reload of definitions from package
One thing you can do is to develop in the FrontEnd, and have your cell context set to whatever your package's private context is (Foo`Private` ). You can then execute it inside BeginPackage["Foo`"] - EndPackage[]. In such a case, you will automatically patch your loaded code, and only with the changes you actually make. When the code is complete, you can move it from FrontEnd to the file.
Apr
22
comment Partial reload of definitions from package
This is probably possible, and an interesting (and important) problem, but this isn't very easy to make robust. Basically, one needs both static analysis on the code, and dynamic analysis on the loaded version, and then a kind of a diff that would tell what the changes are, and then functionality to properly load those changes. We have bits and pieces needed for this scattered in the answers on this site, but this doesn't strike me as a simple project. I will keep it in mind but can't give a good answer right away. You may have luck with some partial solutions.
Apr
22
comment Generic templating system
No, there isn't currently any documentation. This is a new development, it only exists in version 10. It is currently mostly used by Dataset, but can have uses on its own too.
Apr
17
comment Can we say that “all functions in Mathematica are some kind of pattern-matching-and-replacement procedures”?
Actually, I also forgot compiled functions, as the posted answer reminded me (but compiled functions are relatively rarely created at runtime, unlike pure functions).
Apr
17
comment Can we say that “all functions in Mathematica are some kind of pattern-matching-and-replacement procedures”?
One notable example where this is not the case are pure functions. But, unless I am forgetting something, it seems to indeed be the only one.
Apr
15
comment Combining memoization and SlotSequence
@rasher Comments are not supposed to be actual answers. But they can provide a light-weight way to answer or give hints. If someone takes a comment of someone else and posts this (or similar) as an answer, this is totally fine, I think.
Apr
15
comment Combining memoization and SlotSequence
You also could use something like this: ClearAll[p]; p[x_] := p[x] = b^0*a[x]; p[fst___, x_, y_] := p[fst, x, y] = p[fst, x] + b^(Length[{fst}] + 1)*a[x + y].
Apr
14
comment Is it possible to `Protect` a dynamic programming process?
@Santi This is surely possible. The simplest is to have a list of functions and automate this, like Scan[Function[sym, Pattern[call,Blank[sym]] /; MemberQ[Attributes[sym], Protected]:= withCodeAfter[Unprotect[sym];call, Protect[sym]]], {func1,func2,func3}] (untested, but you get the idea).
Apr
12
comment Programmatic formatting for Mathematica code - possible?
@HyperGroups Well, first of all, CodeFormatterMakeBoxes takes an expression (just like MakeBoxes), not a boxed form, while your cells contains already boxed form of an expression. So, you still need to provide a wider context of what you need, preferably in that question (not here). As to overriiding HoldAllComplete, one possibility is to do what Kuba suggested: CodeFormatterMakeBoxes[#]&[expr].
Apr
12
comment Programmatic formatting for Mathematica code - possible?
@HyperGroups What is the exact expression you want to convert to boxes? What is in cells variable? You don't give enough information to answer your question.
Apr
2
comment Why is a symbol still found after changing its context?
As for 2: I have not seen mentions of this in the docs, but this has certainly been noticed and discussed here on SE before. In particular, I made use of this effect here, where also the comments below that answer refer to earlier discussions regarding this topic. In fact, those comments also mention the first point in your question, although give no answer for it.
Mar
30
comment How do I get my equation to have the form $(x-a)^2 + (y-b)^2 + (z-c)^2-d = 0$?
@Kuba In general, it is. The first form relegates the default value to the function where you use the pattern, the second one specifies it explicitly.
Mar
27
comment DatePlus and DayPlus perform much worse than my user-defined-function
Have you seen some of the past questions / answers on this topic, involving Java, like this discussion for instance? I found that for date functions, and when you need to perform operations in a bulk, this approach works well.
Mar
27
comment Ordered associations
Apparently, this seems to not be mentioned in the docs explicitly, at least not on the main Association doc page. One can sort of figure this out by the fact that one can use Part with numerical indices on associations, but such fundamental property should be mentioned explicitly. I will file a suggestion report.
Mar
27
comment Ordered associations
Associations are ordered.
Mar
24
comment Why can I not replace a Dataset using a rule?
+1. Apparently, more complex solutions are always late.