bug-mit-scheme
[Top][All Lists]
Advanced

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

[bug #64636] Libraries don't seem to close over internal definitions upo


From: Arthur A. Gleckler
Subject: [bug #64636] Libraries don't seem to close over internal definitions upon which they depend.
Date: Fri, 8 Sep 2023 14:18:44 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?64636>

                 Summary: Libraries don't seem to close over internal
definitions upon which they depend.
                   Group: MIT/GNU Scheme
               Submitter: aag
               Submitted: Fri 08 Sep 2023 11:18:42 AM PDT
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                Keywords: 


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Fri 08 Sep 2023 11:18:42 AM PDT By: Arthur A. Gleckler <aag>
In the following two library definitions, I would expect not to need to export
quux from library bar in order to use it in exported macro baz.  After all,
baz is defined in an environment in which it sees quux, so it should be closed
over quux.  This works in Chibi Scheme.  In MIT Scheme, I get the error
below.


(define-library (foo)
  (export bat)
  (import (bar))
  (import (scheme base))
  (begin
    (define (bat) (baz alpha bravo))))

(define-library (bar)
  (export baz)
  (import (scheme base))
  (begin
    (define (quux x y) (list y x))
    (define-syntax baz
      (syntax-rules ()
        ((_ a b) (quux 'a 'b))))))

1 ]=> (find-scheme-libraries! "$t/library-experiments/syntax-dependencies/")

;Registering library (bar) from "bar.sld"... done
;Registering library (foo) from "foo.sld"... done
;Unspecified return value

1 ]=> (ge '(foo))

;Loading "/home/arthur/tmp/library-experiments/syntax-dependencies/foo.sld"...
done
;Loading "/home/arthur/tmp/library-experiments/syntax-dependencies/bar.sld"...
done
;library: (foo)
;Value: #[environment 12]

1 ]=> (bat)

;Unbound variable: quux
;To continue, call RESTART with an option number:
; (RESTART 3) => Specify a value to use instead of quux.
; (RESTART 2) => Define quux to a given value.
; (RESTART 1) => Return to read-eval-print level 1.

2 error>









    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64636>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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