« first day (3314 days earlier)      last day (1468 days later) » 

01:26
@CraigCarter I typically build up dependent values with something like <|"a" -> 1, "b" -> 2|> // <|#, "c" -> #a + #b|> &
 
15 hours later…
16:12
@MichaelHale, Ah, I see. Thanks. I am trying to understand the performance implication of doing something like this (I need something speedy).
list = <|"a" -> #, "b" -> 2 #, "c" -> Missing[]|> & /@ Range[10]

update[assocList_] := <|#, "c" -> #["a"] + #["b"]|> & /@ assocList

list = update[list]
How much overhead am I incurring by overwriting list like that?
16:48
Does anyone know of a reference that explains when one should use associations and when to use lists? This is a simplified case that indicates that straightforward usage tends to favor lists (considering speed only):
bigList = RandomReal[1, {10^6, 2}];
bigAssocList =
MapThread[<|"a" -> #1, "b" -> #2|> &, Transpose@bigList];

RepeatedTiming[Total[bigList[[All, 1]]]]

RepeatedTiming[Total[Lookup[bigAssocList, "a"]]]

Extracting values from the association is an order of magnitude slower.
What should I be reading to understand this?
17:04
Mathematica has a guide on associations
I use them when I need to lookup things which are not naturally ordered as 1,2,3 elements of a list. (For example arranging terms in equations according to how many derivatives are hitting the unknown functions, when not all possible number of derivatives are present)
does somebody know how I can pass a value and a variable to a function, so that it uses them inside a block

For example,

testFunc[var_, varVal_] := Block[{var = varVal}, Print[varVal + 5]]

marks `var` inside the `Block` in red. I need to do that, because I need to call the function with different values for different variables, but I want it all done locally, so it does not change the values of these variables outside the function
oops, the exmaple is wrong
testFunc[var_, varVal_] := Block[{var = varVal}, Print[x + 5]]
testFunc[x, 3]
8
 
2 hours later…
19:45
Anyone played with CodeAssistOptions -> {"MatchingAlgorithm" -> "Fuzzy"}? @halirutan?

« first day (3314 days earlier)      last day (1468 days later) »