diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-12-27 17:08:53 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-12-27 17:08:53 -0800 |
commit | dd837c4231ffa644b60e4b6e804014e8742faad4 (patch) | |
tree | ac6412a2ed9e2a31789b39b9bd30c19cb589c45b | |
parent | 218d340d354799b12aabd1d1f243ee32e821a37f (diff) | |
download | txr-dd837c4231ffa644b60e4b6e804014e8742faad4.tar.gz txr-dd837c4231ffa644b60e4b6e804014e8742faad4.tar.bz2 txr-dd837c4231ffa644b60e4b6e804014e8742faad4.zip |
comb: eliminate comb_hash_while_fun.
* combi.c (comb_hash_while_fun): Function removed.
(comb_hash): For the while function, use the
unwrapped state, and just comb_while_fun.
The augmented state with hash is used only with
comb_hash_gen_fun.
-rw-r--r-- | combi.c | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -502,11 +502,6 @@ static val comb_str(val str, val k) func_f0(state, comb_str_gen_fun)); } -static val comb_hash_while_fun(val state) -{ - return car(car(state)); -} - static val comb_hash_gen_fun(val hstate) { val self = lit("comb"); @@ -524,11 +519,11 @@ static val comb_hash_gen_fun(val hstate) return out; } - static val comb_hash(val hash, val k) { - val hstate = cons(comb_init(hash_alist(hash), k), hash); - return generate(func_f0(hstate, comb_hash_while_fun), + val state = comb_init(hash_alist(hash), k); + val hstate = cons(state, hash); + return generate(func_f0(state, comb_while_fun), func_f0(hstate, comb_hash_gen_fun)); } |