diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-12-07 10:59:19 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-12-07 10:59:19 -0800 |
commit | 79781ded91b29fbdc406d460e466c5ffb06a1454 (patch) | |
tree | 2f44c3b8091a1fe8d397af2e577448ceb89031e7 /lib.c | |
parent | bf486523ab87ce43d5cc880fd0e2dd5f48cd819b (diff) | |
download | txr-79781ded91b29fbdc406d460e466c5ffb06a1454.tar.gz txr-79781ded91b29fbdc406d460e466c5ffb06a1454.tar.bz2 txr-79781ded91b29fbdc406d460e466c5ffb06a1454.zip |
* eval.c (lookup_var, lookup_fun): Reversing assoc arguments.
(eval_init): New intrinsics.
* hash.c (struct_hash): assoc_fun parameters reversed.
(gethash, gethash_f, gethash_n): Likewise.
* lib.c (assoc, assq): Reversing parameters.
(find_package, acons_new, acons_new_l, aconsq_new): Reversing
arguments to assoc adn assq.
* lib.h (assoc, assq): Declarations updated.
* match.c (dest_set, dest_bind, h_var, h_coll, h_parallel, h_fun,
subst_vars, do_txeval, v_next, v_parallel, v_gather, v_collect,
v_flatten, v_cat, v_output, v_filter, f_fun, match_funcall):
Reversing arguments to assoc.
* unwind.c (uw_get_func, uw_exception_subtype_p, uw_register_subtype):
Reversing arguments to assoc.
* txr.1: Blank sections created for new functions.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1632,7 +1632,7 @@ val make_package(val name) val find_package(val name) { - return cdr(assoc(packages, name)); + return cdr(assoc(name, packages)); } val intern(val str, val package) @@ -2668,7 +2668,7 @@ mem_t *cptr_get(val cptr) return cobj_handle(cptr, cptr_s); } -val assoc(val list, val key) +val assoc(val key, val list) { while (list) { val elem = car(list); @@ -2680,7 +2680,7 @@ val assoc(val list, val key) return nil; } -val assq(val list, val key) +val assq(val key, val list) { while (list) { val elem = car(list); @@ -2699,7 +2699,7 @@ val acons(val car, val cdr, val list) val acons_new(val key, val value, val list) { - val existing = assoc(list, key); + val existing = assoc(key, list); if (existing) { *cdr_l(existing) = value; @@ -2711,7 +2711,7 @@ val acons_new(val key, val value, val list) val *acons_new_l(val key, val *new_p, val *list) { - val existing = assoc(*list, key); + val existing = assoc(key, *list); if (existing) { if (new_p) @@ -2728,7 +2728,7 @@ val *acons_new_l(val key, val *new_p, val *list) val aconsq_new(val key, val value, val list) { - val existing = assq(list, key); + val existing = assq(key, list); if (existing) { *cdr_l(existing) = value; @@ -2740,7 +2740,7 @@ val aconsq_new(val key, val value, val list) val *aconsq_new_l(val key, val *new_p, val *list) { - val existing = assq(*list, key); + val existing = assq(key, *list); if (existing) { if (new_p) |