∅:D[
5.3138] → [
6.40886:40889]
B:BD[
6.40886] → [
6.40886:40889]
B:BD[
6.40889] → [
2.6076:6355]
∅:D[
2.6355] → [
5.3185:3241]
B:BD[
5.3185] → [
5.3185:3241]
B:BD[
5.3241] → [
2.6356:6472]
∅:D[
2.6472] → [
5.3241:3300]
B:BD[
5.3241] → [
5.3241:3300]
B:BD[
5.3300] → [
2.6473:6739]
∅:D[
2.6739] → [
5.3407:3453]
B:BD[
5.3407] → [
5.3407:3453]
}
# this is dead code. i tried to make it iterative and write it in awk
# so it would be faster, but it ended up eval-ing things too many
# times and i couldn't figure out where the problem was, even with
# copious debug logging.
function _mapcar(fun, lis, env, d, v, app, acc) {
if(_is_null(lis)) {
return lis
} else {
# fun and lis are already evaluated
logg_dbg("_mapcar", "fun: " _repr(fun) "; lis: " _repr(lis), d)
for(acc=_nil(); !_is_null(lis); lis = _cdr(lis)) {
app = _cons(fun, _cons(_car(lis),
_nil()))
logg_dbg("_mapcar", "evaling: " _repr(app), d)
v = _eval(app, d+1)
logg_dbg("_mapcar", "result: " _repr(v))
acc = _cons(v, acc)
}
return _nreverse(acc)
}