Summary
define-syntax on imported syntax redefines that syntax in the original module
Metadata
- Id: b5725dd9d4070764951fab04f33be02414e2285f
- Trac id: 19
- Type: defect
- Reporter: ashinn
- Owner: felix
- Cc:
- Status: closed
- Component: compiler
- Estimated difficulty:
- Resolution: wontfix
- Priority: minor
- Milestone:
- Version: 4.0.1
- Changetime: 2009-05-07 12:23:34 UTC
- Created: 2009-04-25 13:08:00 UTC
- Keywords:
Description
CHICKEN (c)2008-2009 The Chicken Team (c)2000-2007 Felix L. Winkelmann Version 4.0.2 - SVN rev. 14239 macosx-unix-gnu-x86 [[|manyargs dload ptables applyhook ]] compiled 2009-04-16 on pchelka (Darwin)
#;1> (module x () (import scheme) (define-syntax import (syntax-rules ())))
- loading /usr/local/lib/chicken/4/scheme.import.so ...
Warning: redefinition of imported syntax binding: import #;2> (module y () (import scheme) 'ok)
Error: during expansion of (import ...) - no rule matches form: (import scheme)
Call history: <syntax> (module y () (import scheme) (quote ok)) <syntax> (##core#module y () (import scheme) (quote ok)) <syntax> (import scheme) <eval> (##sys#cdr input10) <eval> (##sys#syntax-error-hook "no rule matches form" input10<--
#;2>
Changes and comments
[2009-04-25 23:09:44 UTC] felix changed priority from major to minor
[2009-04-25 23:09:44 UTC] felix changed status from new to assigned
[2009-04-25 23:09:44 UTC] felix wrote:
Funky.
Has a nice correspondence to redefining imported variables...
This is a bug, of course, but an interesting one.
[2009-05-07 12:23:34 UTC] felix changed status from assigned to closed
[2009-05-07 12:23:34 UTC] felix set resolution to wontfix
[2009-05-07 12:23:34 UTC] felix wrote:
As the module system does merely rename identifiers (and does not instantiate environments), this behaviour is actually consistent: redefinition of a global value binding changes that value globally. Redefinition of a syntax binding changes the meaning of the syntax in the compiler-run or interpreter session. One can still consider this a bug (and I'm not overly happy with this, since users will probably expect something else), but the current behaviour is, technically, the proper thing to do.