...
 
Commits (2)
......@@ -108,6 +108,8 @@
(case-lambda
((self)
(__init__ self ""))
((self s x . l)
(__init__ self (apply py-encode s x l)))
((self s)
(cond
((is-a? s <string>)
......
......@@ -265,6 +265,16 @@ empty list."
(fluid-ref %dont-warn-list))))
(lambda x (values))))
(define (dont-warn* v)
(catch #t
(lambda ()
(hash-set!
%eval-no-warn
(current-module)
(cons v (hash-ref %eval-no-warn (current-module) '()))))
(lambda x (values))))
(define-syntax call
(syntax-rules ()
((_ (f) . l) (f . l))))
......@@ -2278,8 +2288,10 @@ empty list."
(if (pair? start)
(set! x (cdr x)))
(let* ((globs (get-globals x))
(sc (scope x '()))
(res (gensym "res"))
(e (map (g globs exp) x)))
(for-each dont-warn* sc)
`(begin
,@start
,@(map (lambda (s)
......
(define-module (language python guilemod)
#:use-module (system base message)
#:export (%add-to-warn-list %dont-warn-list))
#:export (%add-to-warn-list %dont-warn-list %eval-no-warn))
(define-syntax-rule (aif it p . l) (let ((it p)) (if it . l)))
(define %eval-no-warn (make-hash-table))
(define-syntax-rule (mk-commands path mod-C define-C define-exp-C define-set-C)
(begin
(define mod-C (resolve-module 'path))
......@@ -138,9 +140,12 @@
(unbound-variable
"report possibly unbound variables"
,(lambda (port loc name)
(if (not (member name
(fluid-ref
%dont-warn-list)))
(if (and (not (member name
(fluid-ref
%dont-warn-list)))
(not (member name
(hash-ref %eval-no-warn
(current-module) '()))))
(emit port
"~A: warning: possibly unbound variable `~A'~%"
loc name))))
......
......@@ -3,6 +3,7 @@
#:use-module (language python exceptions)
#:use-module (language python hash)
#:use-module (language python compile)
#:use-module (language python list)
#:use-module (language python module io)
#:use-module (language python try)
#:use-module (language python string)
......@@ -154,10 +155,10 @@
(define maxsize (- (ash 1 63) 2))
(define maxunicode #f)
(define meta_path '())
(define meta_path (to-pylist '()))
(define modules (@ (language python module) modules))
(define path %load-path)
(define path_hooks '())
(define path (to-pylist %load-path))
(define path_hooks (to-pylist '()))
(define path_importer_cache (make-hash-table))
(define-python-class hash_info ()
......