contains_symbols is/was exhibiting exponential behavior - probs memoizing or using needed_for_eval could fix it, but also it doesn't normally have to be called, so just doing that got us a 50x speedup or so

This commit is contained in:
Nathan Braswell
2022-01-26 23:43:50 -05:00
parent c8df8742d1
commit 2746e1ca75
2 changed files with 23 additions and 20 deletions

View File

@@ -20,10 +20,12 @@
(let1 let (vY (lambda (recurse) (vau de (vs b) (cond (= (len vs) 0) (eval b de)
true (vapply let1 (array (idx vs 0) (idx vs 1) (array recurse (slice vs 2 -1) b)) de)))))
(let (a 1337)
(array 'open 3 "test_self_out" (lambda (fd code)
(array 'write fd "wabcdefghijk" (lambda (written code)
(array 'exit written)))))
(array 'exit (+ a written))))))
)
;(array 'write 1 "test_self_out2" (vau (written code) 1))