I got rid of every define-macro (lambda forever!) and I still have the problem, but it's very strange.
If I "include" or "##include" a file that has the definition of ->computable, I have the problem:
heine:~/text/courses/computation/computational-reals/app/crap/minimal> gsi CReals.scm *** ERROR IN loop, "basics.scm"@62.30-62.36 -- computable-sqrt: argument is negative: #<procedure #2> ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ basics.scm ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ┃⋯ 61┃ (let* ((k* (+ k (integer-length k))) 62┃ (result (x k*))) 63┃ (set! result-so-far (cons k* result)) ┃⋯
But if I *don't* include the file but include the definition of ->computable by itself:
#; (include "arithmetic.scm")
(define (->computable r) (if (not (rational? r)) (error "->computable: argument is not rational: " r) (let ((r (exact r))) (cond ((integer? r) (case r ((0) computable-zero) ((1) computable-one) ((-1) computable-negative-one) (else (lambda (n) (arithmetic-shift r n))))) ;;<< the result ((power-of-two? (denominator r)) (let ((num (numerator r)) (log_2-den (first-set-bit (denominator r)))) (lambda (n) (arithmetic-shift num (- n log_2-den))))) (else (computable-memoize (lambda (n) (round (* r (expt 2 n))))))))))
then the problem goes away!!!!
heine:~/text/courses/computation/computational-reals/app/crap/minimal> gsi CReals.scm *** ERROR IN "CReals.scm"@232.13-232.24 -- (Argument 1) Out of range (CRsqrt -5) ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ CReals.scm ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ┃⋯ 231┃ 232┃(CR->string (CRsqrt -5))
No define-macro's:
grep define-macro *
Suggestions?
Brad