commit 91acffc08629c036885d1b471f947103746d78d3 parent ee593db8f702acefb60ae34e95e29f0eda151bd4 Author: Ed van Bruggen <edvb@uw.edu> Date: Thu, 19 Dec 2019 20:01:28 -0800 Fix recur by using recursive let Broken by corrected function and macro evaluation, implement it the right way now Diffstat:
tibs/lib.tsp | | | 10 | ++++++---- |
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tibs/lib.tsp b/tibs/lib.tsp @@ -78,10 +78,12 @@ (list 'define (car x) (cadr x))) vars) body)))) -(defmacro (recur fn vars . body) - (list* (list* 'lambda (cons fn (map car vars)) body) - (list* 'lambda (map car vars) body) - (map cadr vars))) +(defmacro (recur proc vars . body) + (list 'let + (list* + (list proc (list* 'lambda (map car vars) body)) + vars) + (list* proc (map car vars)))) ;;; Logic (define true t)