better guilemod

parent 373d3f05
(define-module (language python guilemod)
#:export ())
(define-syntax-rule (aif it p . l) (let ((it p)) (if it . l)))
(define-syntax-rule (mk-commands path mod-C define-C define-exp-C define-set-C)
(begin
(define mod-C (resolve-module 'path))
......@@ -241,27 +243,15 @@
(define pload
(let ((guile-load (@ (guile) primitive-load-path)))
(lambda (p . q)
(let ((tag (make-prompt-tag)))
(call-with-prompt
tag
(lambda ()
(guile-load p (lambda () (abort-to-prompt tag))))
(lambda (k)
(let lp ((l *extension-dispatches*))
(if (pair? l)
(let lp2 ((u (caar l)))
(if (pair? u)
(let ((tag (make-prompt-tag)))
(call-with-prompt
tag
(lambda ()
(guile-load (string-append p "." (car u))
(lambda () (abort-to-prompt tag))))
(lambda (k) (lp2 (cdr u)))))
(lp (cdr l))))))
(if (pair? q)
((car q))
(error (string-append "no code for path " p)))))))))
(let lp ((l *extension-dispatches*))
(if (pair? l)
(let lp2 ((u (caar l)))
(if (pair? u)
(aif it (%search-load-path (string-append p "." (car u)))
(apply guile-load it q)
(lp2 (cdr u)))
(lp (cdr l))))
(apply guile-load p q))))))
(define-set-G primitive-load-path pload)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment