Reputation
69,173
Next tag badge:
211/100 score
19/20 answers
Badges
6 204 295
Newest
 Nice Answer
Impact
~447k people reached

Mar
6
comment Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
@Mr.Wizard No problem. This is an important topic, so sooner or later we had to cover it somewhere.
Mar
6
comment Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
@ecoxlinux These renamings are excessive, it seems - and it is also mentioned in the docs. So, yes, it sees the conflict in the body but does renamings of function's variables.
Mar
6
comment Reading periodic elements from a large file
@s0rce Ok, see here
Mar
6
comment Reading periodic elements from a large file
@s0rce But why do you need to modify it at all? It has already a method getFloatColumn, and above there is an example of how to use it. All you have to do is to compute the offsets and total byte count of a row - and then just use it.
Mar
6
comment Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
I hope it did not insult you that I changed your original post considerably. Please feel free to roll back if you don't like it.
Mar
6
comment Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
@Szabolcs I did not really study the internal implementation, so all I can say about this has a status of an educated guess. I tried to describe this mechanism above, in my edit - see if you find this a satisfactory answer to your question.
Mar
6
comment Looking for “Longest Common Substring” solution
@s0rce Thanks for this input. I really have to set the time to fix this thing on all platforms. Hope to do this very soon.
Mar
6
revised Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
Added some discussion on general mechanism of renaming
Mar
6
comment Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
I think it is still not clear enough. Do you mind if I contribute to your answer?
Mar
6
comment Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
@Szabolcs It is Module that we are trying to fool here, not Function, thus this behavior - see my comment below Mr.Wizard's answer.
Mar
6
comment Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
+1. The real reason why the version with Function[x, z] /. z -> expr does not work is that the one we are trying to fool here is not Function, but Module. It is Module that performs the renaming inside Function, and it uses verbatim search for Function[something] in the code of Module. This is why things like Function @@ ... work. I think it is important to realize this.
Mar
6
revised Voronoi diagrams for generators other than points
edited tags
Mar
6
comment Variable name string to expression
@rm-rf Not sure about that. It is probably the best place for it that we currently have, but I would prefer a dedicated question sounding something like "best practices in making assignments and using variables in Mathematica". There are actually two separate problems mixed in this and other similar questions: using (or not) string names, and making automated assignments to a bunch of variables. Both could be covered in that canonical question / answer.
Mar
6
comment Variable name string to expression
@rm-rf Looks like we need one canonical answer to bind them all. All those look at some aspects of this problem, but I can't say that any of them are exact duplicates of this one.
Mar
6
revised How can I get a single solution to a set of inequality constraints?
edited tags
Mar
6
revised Variant of the cutting-stock problem in Mathematica
added 355 characters in body
Mar
6
comment Why doesn't PatternTest work with Composition?
@JacobAkkerboom That's a good point. But this is probably less frequent use case.
Mar
6
answered Variant of the cutting-stock problem in Mathematica
Mar
5
comment How does MakeBoxes handle an n-ary operator?
@RandomBits No, in this case you don't need this, since you explicitly place x and y into MakeBoxes. We needed it in the case of xO, since we had a variable number of arguments, and we needed to protect those from early evaluation during our manipulations. In this case, this programmatic manipulation stage is absent. You may want to make xPower HoldAll or HoldAllComplete though.
Mar
5
revised A Faster way to combine two Lists of different structures into one of a different structure
Added benchmarks