Tag Info

New answers tagged

8

I hesitate to add anything after @Leonid's comprehensive answer, but I'd like to point out that an easy way to achieve the stated goal is to define f like this: f[x_] := <| x, "isFirstValueTrue" -> x@"firstValue" |> ... which yields the desired result when mapped across the associations in x: f /@ x (* { <|"firstValue" -> True, ...


14

Preamble This is a very good question, because answering it will make it very clear what immutability means, both in general and in the context of Associations. General A few general words on immutability Associations are immutable data structures. This means that they carry no state, and a copy of an Association is another completely independent ...


1

I propose using the step function I presented in: How do I evaluate only one step of an expression? (For the remainder of this answer I will assume you have that function loaded.) I wrote it for the purpose of handling delayed definitions such as: expr := (p == q || p == q + 1) You could use it in the following manner: SetAttributes[f, HoldFirst] ...



Top 50 recent answers are included