Summary

define-syntax on imported syntax redefines that syntax in the original module

Metadata

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.