diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-12-16 06:14:10 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-12-16 06:14:10 -0800 |
commit | 9bd8fabc9f45dbdb7c66c44f255904ab62df4ee3 (patch) | |
tree | 94294509dda1092ab631c9453d03817e3e7dab09 /lib.c | |
parent | 2bc41c8920513856daa73018e6b9f9c54f456fe2 (diff) | |
download | txr-9bd8fabc9f45dbdb7c66c44f255904ab62df4ee3.tar.gz txr-9bd8fabc9f45dbdb7c66c44f255904ab62df4ee3.tar.bz2 txr-9bd8fabc9f45dbdb7c66c44f255904ab62df4ee3.zip |
bugfix: dwim_set not handling hash correctly.
* lib.c (dwim_set): When the range argument is a
vector or list, it is wrongly hangled through replace, even if
seq is a hash. replace throws since it doesn't handle hashes.
We must treat the vector or list as a hash key and
handle through sethash.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -7625,6 +7625,10 @@ val dwim_set(val seq, val ind_range, val newval) case CONS: case LCONS: case VEC: + if (hashp(seq)) { + (void) sethash(seq, ind_range, newval); + return seq; + } return replace(seq, newval, ind_range, colon_k); case RNG: if (!hashp(seq)) |