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

21h
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.
1d
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.
1d
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.
1d
awarded  Nice Answer
2d
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.
2d
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
22
answered Generic templating system
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
awarded  Enlightened
Apr
14
awarded  Guru
Apr
14
awarded  Nice Answer
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
14
awarded  Good Answer
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.