4,494 reputation
21752
bio website
location
age
visits member for 3 years, 2 months
seen 6 mins ago

Mar
16
comment How to evaluate a function on a list until stable?
There's a FixedPoint function.
Mar
13
comment Missing elements using FinancialData
this will help mathematica.stackexchange.com/q/46760/66
Mar
9
comment Where can I find examples of good Mathematica programming practice?
Ok, I've found another source for the doc and updated the list.
Feb
13
comment Wolfram Workbench - Mathematica Development Alternatives
Wolfram Workbench is still useful for big projects involving several packages. I don't think you can rename a function accross several packages with notebooks in one command.
Feb
7
comment Smart pointer for Mathematica?
My goal would be to do Class[object].delete[] when the reference would be garbage collected. So even if Temporary were a solution, I would still need to know when the deletion of the temporary symbol happens.
Feb
1
comment Using up-values and down-values
Thanks but G[2,e] can be an intermediate state. An object e[2] might call the definition of f stored in G, the call will then be G[2,e].f[]. But if I return just the object, I want it to be returned as e[2], ie it's main representation.
Feb
1
comment Using up-values and down-values
e[2] is the main representation of G[2,e] in what I do, so it's ok for me, I agree with you warning, but it doesn't impact me (at least for now, if it backfires I'll go back to my previous way of doing).
Feb
1
comment Using up-values and down-values
The way you handle Stack is interesting in order to just get the useful information from the stack.
Feb
1
comment Using up-values and down-values
Note that I never have pure patterns in my use cases, so Simplify is not useful in this case, although it's still interesting to know this.
Feb
1
comment Using up-values and down-values
I have quite a big project with such data structures as underlying objects as described in my post on structs in Mathematica mathematica.stackexchange.com/a/999/66, I have improved the ideas exposed on this site a lot, since posting them here, I will probably release a package publicly at some point. So your solution with my slight modification doesn't crash the system so it's very likely the right solution.
Feb
1
comment Using up-values and down-values
@ybeltukov , your solution works for my use case with this slight modification: h_[a___, G[x_, , y], b_] /; h =!= Dot ^:= h[a, y[x], b] . Thanks a lot for helping me, thanks to Leonid also for trying.
Jan
31
comment How to implement the Observer design pattern?
@LeonidShifrin your answer is so useful, I think it should be included in the language as a means for asynchronous programming. Maybe Java could be used also in Mathematica for asynchronous programming, although I haven't looked at this yet.
Jan
28
comment Mathematica style guide?
I thought it was an interesting question. If it's too broad so be it, you can delete it ...
Jan
11
comment Equivalent of ReplaceAll for Associations?
It's as if Association had a Flat attribute.
Jan
8
comment Mathematica Application in Real Life
Funny answer ! I never used MM like this yet !
Jan
7
comment Graph databases / Nosql with Mathematica
2 votes ! Finally ! Lol
Dec
28
comment How to avoid an expensive subset of a Manipulate computation when dependent variables have not changed?
Just as a comment, this method uses Manipulate as a DynamicModule, which offers more possibilities. "None" is a way to define DynamicModule variables in Manipulate. This method is really practical.
Dec
27
comment What are the most common pitfalls awaiting new users?
In fact a Hold attribute is not needed for destructuring as a DownValues definition for f already uses HoldPattern
Dec
23
comment What are the most common pitfalls awaiting new users?
Holding evaluation allows to destructure arguments and modify them before evaluation SetAttributes[f, HoldFirst]; f[h_[b_]]:={h,b}; f[g[2]]
Dec
23
comment What are the most common pitfalls awaiting new users?
An easy way to understand Mathematica's evaluation: consider a function/tree f[a,b]. Without any particular attribute for f the leafs/arguments will be evaluated before the parent f. With f having a HoldAll attribute you don't evaluate the leafs but go directly in the evaluation of f. a and b will be evaluated as soon as they are used in a function that doesn't hold again their evaluation. Example SetAttributes[f, HoldAll]; f[a_,b_]:= a Hold[b]; f[2^2,2^2]