Opened 18 months ago

Last modified 5 months ago

#1812 new defect

Modules leaking define-for-syntax variables and functions

Reported by: Idiomdrottning Owned by:
Priority: major Milestone: 6.0.0
Component: core libraries Version: 5.3.0
Keywords: modules, syntax Cc:
Estimated difficulty:

Description

(module foo
(foo-deluxe)
(import scheme (chicken base) (chicken syntax))
(define-for-syntax (bar) (print "hi!"))
(define-syntax foo-deluxe
  (syntax-rules ()
    ((foo-deluxe) (bar))))
)

(import foo)
(foo-deluxe)
(bar)
(set! bar #f)
(foo-deluxe)

Is this intentional?

Change History (2)

comment:1 Changed 5 months ago by felix winkelmann

Milestone: someday6.0.0

comment:2 Changed 5 months ago by felix winkelmann

This is currently not really done at all. The "meta" environment is the same as the global toplevel evaluation environment. The proper thing to do here is probably to create a fresh, distinct meta-environment for every module, initialized to "scheme".

Note: See TracTickets for help on using tickets.