chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-janitors] #1548: Extra modules leak into environment when using


From: Chicken Trac
Subject: [Chicken-janitors] #1548: Extra modules leak into environment when using -j
Date: Wed, 10 Oct 2018 05:25:56 -0000

#1548: Extra modules leak into environment when using -j
----------------------+----------------------------
 Reporter:  megane    |                 Owner:
     Type:  defect    |                Status:  new
 Priority:  major     |             Milestone:  5.0
Component:  compiler  |               Version:  5.0
 Keywords:  macro     |  Estimated difficulty:
----------------------+----------------------------
 Found by dieggsy on IRC.

 When defining multiple modules in a single file and generating an import
 file for only one of those the namespace from the other modules leaks into
 the importing code.

 In this case it's the srfi-13 leaking into the importing code. Just saying
 `(import m)` should only bring module `m`'s imports into the environment.

 This seems to be a regression from C4.

 {{{
 (module helper *
         (import scheme)
         (import srfi-13)
         ;; (import chicken) (use srfi-13) ; for C4

         (define-syntax complex-foreign-lambda
           (ir-macro-transformer
            (lambda (e i c)
              `(begin)))))

 (module m *)
 }}}

 ;; 4.13.0
 ;; $ csc -s m.scm -j m && csi -qbn -e '(import m) (print (string-null? "")
 (string-null? "1"))'
 ;;
 ;; Error: unbound variable: string-null?

 ;; chicken-5.0.0rc2
 ;; $ csc -s m.scm -j m && csi -qbn -e '(import m) (print (string-null? "")
 (string-null? "1"))'
 ;; #t#f

 ;; $ csc -debug 2 -s m.scm -j m
 ;; [canonicalized]
 ;; (##core#callunit library)
 ;;
 ;; (##core#callunit eval)
 ;;
 ;; (##core#callunit expand)
 ;;
 ;; (##core#undefined)
 ;;
 ;; (##core#undefined)
 ;;
 ;; (##core#undefined)
 ;;
 ;; (let ((t43 (##core#provide helper#)))
 ;;   (let ((t44 (scheme#eval '(import-syntax scheme srfi-13)))) ; <----
 offending import
 ;;     (let ((t45 (##sys#register-compiled-module
 ;;                  'helper
 ;;                  'helper
 ;;                  (scheme#list)
 ;;                  '()
 ;;                  (scheme#list
 ;;                    (scheme#cons
 ;;                      'complex-foreign-lambda
 ;;                      (chicken.syntax#ir-macro-transformer
 ;;                        (##core#lambda (e37 i38 c39) (##sys#list
 'begin)))))
 ;;                  (scheme#list))))
 ;;       (let ((t46 (chicken.load#load-extension 'srfi-13 '(srfi-13#)
 'require)))
 ;;         (##core#undefined)))))
 ;;
 ;; (##core#provide m#)
 ;;
 ;; (##core#undefined)

--
Ticket URL: <https://bugs.call-cc.org/ticket/1548>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]