Reputation
68,463
Next tag badge:
211/100 score
19/20 answers
Badges
6 200 293
Newest
 Enlightened
Impact
~436k people reached

Dec
4
comment Can I make a default for an optional argument the value of another argument?
@rm-rf Besides, what makes you think that \[FormalY] has not been uprotected and assigned a value? :)
Dec
4
comment Can I make a default for an optional argument the value of another argument?
@rm-rf Probably not, but from the point of view of language purity they are someting external. I want my code such that I would have no problem reading it from any editor, not necessarily Mathematica FrontEnd. And just typing \[FormalY] etc puts me off. A matter of taste, I guess.
Dec
4
comment Can I make a default for an optional argument the value of another argument?
@rm-rf I dislike anything which mixes typesetting and coding, when I solve a coding problem, so also formal symbols in this context :)
Dec
4
comment Can I make a default for an optional argument the value of another argument?
@Gabriel One must be careful with saying "x is impossible in Mathematica", I think most of us got into this trap at least once. Never say never :)
Dec
4
comment Reading in Huge Text Files
Well, I think that answer you refer to should be pretty clear, I gave a working example there. As for this comment: I meant to say that BinaryReadList can give you more speed than Import - you can see one of the links in comments above for an example. Also,I linked to another answer of mine, where I used Java to get the file read into Mathematica 50x faster than with BinaryReadList. That answer was tailored to the specific question, but it shows how to do that.
Dec
4
comment Can I make a default for an optional argument the value of another argument?
@Gabriel Sure, no problem :)
Dec
4
comment Can I make a default for an optional argument the value of another argument?
@Gabriel Well, a number of constructive uses of nested scoping constructs formally create variable collisions. Those who use that stuff know exactly how they are resolved, but it makes sense for the highlighter to generally warn about those. In this particular case, the way it works is that Block does localize the special variable created by Module, not the top-level yy, so things are fine.
Dec
4
comment Reading in Huge Text Files
Do you mean my comment or the answer I linked to?
Dec
4
answered Can I make a default for an optional argument the value of another argument?
Dec
4
comment Reading in Huge Text Files
Import is often about the slowest you can have, particularly for tabular data. BinaryRead(List) can be much faster, and Java can give you still much faster reads, when one uses buffer reads
Dec
4
comment What's the best practice for nested local constants?
I would say yes, although this is based on my personal perception and may be not entirely correct.
Dec
4
comment What's the best practice for nested local constants?
I think this could probably be reformulated in a way which would emphasize that you are looking for alternative solutions. If that's so, it does not have to be closed.
Dec
4
comment What's the best practice for nested local constants?
Then I don't see what the question is. My answer is this: yes, this situation is very common in practice, and then I use LetL, described in my answer to that question. The only other option is to separate every single constant's computation into a separate function, and then chain those functions, but often this may not be desirable, both because of extra boilerplate of parameter-passing, and because those new functions may not be general enough to justify their existence.
Dec
4
comment Applying several patterns to `Split`
@John One of the reasons why my code might be faster is that the patterns function here does not short-circuit: even when the very first pattern matches, it still goes on evaluating all others.
Dec
4
awarded  Enlightened
Dec
4
awarded  Nice Answer
Dec
4
comment Use elements of Array inside function definition
You should generaly avoid using Set (=) for function definitions, and you should avoid defining functions which depend on variables implicitly (like on your v here). For the latter, you can read some relevant discussion here.
Dec
4
answered Applying several patterns to `Split`
Dec
4
comment Get the name of a symbol passed to a function
@YvesKlett I got you, just not right away :). And you R right :)
Dec
4
comment Get the name of a symbol passed to a function
@Mr.Wizard In any case, I would not mind you editing my answer(s) as you see fit, so I think this is really not an issue.