Closed svenha closed 8 years ago
I see the problem. It also happens with this simpler file:
(define (b) (a))
(define (a) 1)
and, in the end, it depends upon the following code raising the error when evaluating the first form:
(eval '(define (b) (a)) (interaction-environment))
(eval '(define (a) 1) (interaction-environment))
which is what load
does internally.
I have pushed on the master
branch a change that should mitigate the problem. Syntactic bindings established in a single load file can be defined in any order allowed by a body. Syntactic identifiers in reference position must resolve to syntactic bindings in the current load file or an already loaded load file.
It seems to me that in past months vicare has become much stricter about order of defines. The following code cannot be loaded into vicare anymore.
(define (cartesian-product l1 . l) (if (null? l) (map list l1) (cartesian-product2 l1 (apply cartesian-product l))))
(define (cartesian-product2 l1 l2) (let ((result '())) (let loop ((l0 l1)) (if (null? l0) result (let* ((x1 (car l0)) (result2 (map (lambda (x2) (cons x1 x2)) l2))) (cond ((pair? result2) (cond ((null? result) (set! result result2)) (else (append! result result2))))) (loop (cdr l0)))))))
Copyright (c) 2006-2010 Abdulaziz Ghuloum and contributors Copyright (c) 2011-2015 Marco Maggi and contributors
vicare> (load "bugvicare-a.scm") Unhandled exception Condition components: