summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-11-25 20:45:50 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-11-25 20:45:50 -0800
commitfc68528cf5a7714848d1f4c6ba855b763c49a85e (patch)
tree86f6e52093b071e7ea56a27dc335f1e9ffd2c9d1 /hash.c
parent668209ba08049f1be25d8e5fec282df659c88aab (diff)
downloadtxr-fc68528cf5a7714848d1f4c6ba855b763c49a85e.tar.gz
txr-fc68528cf5a7714848d1f4c6ba855b763c49a85e.tar.bz2
txr-fc68528cf5a7714848d1f4c6ba855b763c49a85e.zip
Bugfix: sethash doesn't return stored value.
sethash mistakenly returns a boolean which indicates that the value was newly added, rather than the documented behavior of returning the new value. * hash.c (sethash): return value rather than new_p. * share/txr/stdlib/place.tl (defplace): The defplace form now seturn the main symbol of the place being defined, rather than returning whatever the last sethash call returns. (define-place-macro): Likewise. (sys:register-simple-accessor): Likewise, so that defaccessor returns the getter function's name.
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hash.c b/hash.c
index e844d5f3..5c10364a 100644
--- a/hash.c
+++ b/hash.c
@@ -626,7 +626,7 @@ val sethash(val hash, val key, val value)
{
val new_p;
rplacd(gethash_c(hash, key, mkcloc(new_p)), value);
- return new_p;
+ return value;
}
val pushhash(val hash, val key, val value)