We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The expression (assoc {:a 1, :b 2, :c 3} :a 9)) should produce the result: {:a 9, :b 2, :c 3}.
(assoc {:a 1, :b 2, :c 3} :a 9))
{:a 9, :b 2, :c 3}
However in ferret this produces the result: {:a 9, :b 1, :c 2}.
{:a 9, :b 1, :c 2}
The :a key is updated appropriately with the new value 9, but the :b and :c keys are getting the shifted original values of :a and :b.
:a
9
:b
:c
The text was updated successfully, but these errors were encountered:
I think the problem is in d_list::dissoc_aux:
d_list::dissoc_aux
for_each(i, _keys) { if (i == k) continue; new_keys = rt::cons(i, new_keys); new_values = rt::cons(rt::first(_values), new_values); _values = rt::rest(_values); }
In the above loop if i == k, the value should be discarded from _values before continuing, e.g.:
i == k
_values
for_each(i, _keys) { if (i == k) { _values = rt::rest(_values); continue; } new_keys = rt::cons(i, new_keys); new_values = rt::cons(rt::first(_values), new_values); _values = rt::rest(_values); }
Sorry, something went wrong.
No branches or pull requests
The expression
(assoc {:a 1, :b 2, :c 3} :a 9))
should produce the result:{:a 9, :b 2, :c 3}
.However in ferret this produces the result:
{:a 9, :b 1, :c 2}
.The
:a
key is updated appropriately with the new value9
, but the:b
and:c
keys are getting the shifted original values of:a
and:b
.The text was updated successfully, but these errors were encountered: