548 reputation
29
bio website
location
age
visits member for 2 years, 6 months
seen 13 hours ago

Jul
14
answered Using levels in MapIndexed
Jul
14
comment Using levels in MapIndexed
@eldo It is not clear to me that this provides the desired answer to the OP's question. In particular, for the c matrix, the third row is transformed to {} rather than the desired {0, Null}.
Jul
13
answered Using “With” outside a function on its parameters
Jul
11
answered How can I change the scoping of a pure function returned by a function in a package?
Jul
9
revised How can I use NestWhileList instead of While in this case?
change 10 to 2 10^6
Jul
9
revised How can I use NestWhileList instead of While in this case?
added 185 characters in body
Jul
9
answered How can I use NestWhileList instead of While in this case?
Jul
7
comment Defining a function that differentiates another function with rule replacement
define it this way: hhpar [x_, y_, i_] := Derivative[1, 0][Evaluate@hh[#1, #2, i] &][x, y]
Jun
2
answered How do I perform the riffle function backward?
Feb
14
comment NMinimize seems to call function with the same values multiple times
@FrederikZiebell I don't understand your comment. I stated that the above code seems to always returns True in my computer. Are you saying that it returns False in yours?
Feb
13
comment NMinimize seems to call function with the same values multiple times
I find the memoization works: ClearAll[f, g]; g = {}; f[x_?NumericQ] := f[x] = (g = {g, x}; x^2); NMinimize[f[x], x, Method -> "RandomSearch"]; DuplicateFreeQ[Flatten[g]] returns True.
Jan
25
awarded  Yearling
Jul
23
answered How to define a function based on the output of DSolve?
May
24
comment Unexpected behavior of Unevaluated
I think the point is that in the example you constructed, when Sequence is removed, this happens after the Unevaluated head would have been taken into account. Hence (together with the fact that when Sequence[] is spliced, it does not triggers a re-evaluation of the entire expression), the inherited Unevaluated head remains.
May
24
comment Unexpected behavior of Unevaluated
@Jacob, I removed the attribute to make that point.
May
24
comment Unexpected behavior of Unevaluated
OK, so if we were to do: ClearAttributes[Unevaluated, HoldAllComplete]; SetAttributes[Unevaluated, HoldAll]; g[_Symbol] := "yay"; x=4; g[Sequence[Unevaluated[x]]] then this still evaluates to g[Unevaluated[x]]. Then, it seems that it is not about updates.
May
24
comment Unexpected behavior of Unevaluated
You seemed to have raised several issues in the body of your question. I tried to answer the actual question you asked at the end of it (which is the same as how you started). The update issues seemed to be a different point/question.
May
22
revised Unexpected behavior of Unevaluated
added more discussion, and linked to another answer.
May
22
revised Unexpected behavior of Unevaluated
minor corrections
May
22
answered Unexpected behavior of Unevaluated