I'm not sure if this is a bug, or if I just am not understanding, properly, how to create a function.
I am able to use a list of rules to update an association like so:
AssociateTo[pools, asocs]
Where pools
is:
<|p10->-0.271069,p11->-0.748554,p12->-0.772571,p13->0.801179,p14->0.823549,p15->-0.617603,p16->-0.171479,p17->0.860391,p18->-0.0937823,p19->0.142897|>
And asocs
is:
{p12 -> -1.0208, p11 -> -1.09988*10^7, p15 -> -0.0190685,
p19 -> 0.075402, p10 -> -0.0904602, p16 -> -0.147492,
p17 -> 0.353486, p13 -> 869.624}
However, when I try to use this function:
updatePoolwithValues[a_, newVals_] := AssociateTo[a, newVals];
I get the following error message:
<|p10->-0.271069,p11->-0.748554,p12->-0.772571,p13->0.801179,p14->0.823549,p15->-0.617603,p16->-0.171479,p17->0.860391,p18->-0.0937823,p19->0.142897|> is not a variable with a value, so its value cannot be changed.
Is this an error, or is there something I am not understanding?
Thanks!