chicken-janitors
[Top][All Lists]
Advanced

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

[Chicken-janitors] #1132: Expansion of internal definitions ignores impo


From: Chicken Trac
Subject: [Chicken-janitors] #1132: Expansion of internal definitions ignores import status/redefinition of `define` et al.
Date: Sat, 14 Jun 2014 03:24:06 -0000

#1132: Expansion of internal definitions ignores import status/redefinition of
`define` et al.
--------------------------------------+-------------------------------------
 Reporter:  evhan                     |       Owner:         
     Type:  defect                    |      Status:  new    
 Priority:  major                     |   Milestone:  someday
Component:  expander                  |     Version:  4.9.x  
 Keywords:  expander, syntax, define  |  
--------------------------------------+-------------------------------------
 Forms starting with {{{define}}}, {{{define-values}}} and {{{define-
 syntax}}} are expanded as internal definitions in let and lambda bodies
 regardless of whether those identifiers have been imported or redefined to
 some other transformer.

 With redefinition:

 {{{
 (define-syntax define
   (syntax-rules ()
     ((_ . a) (list . a))))

 ;; Works, gives (1 2 3).
 (define 1 2 3)

 ;; Works, prints (1 2 3), since the define isn't treated
 ;; as an internal definition.
 (let ()
   (display (define 1 2 3)))

 ;; Fails, errors since the define is treated as an internal
 ;; definition when it should instead return a list.
 (let ()
   (define 1 2 3))
 }}}

 Without having been imported:

 {{{
 ;; Works, errors due to define being unbound.
 (module foo ()
   (import (except scheme define))
   (define a 1))

 ;; Fails, should error due to define being unbound but doesn't.
 (module foo ()
   (import (except scheme define))
   (let () (define a 1)))
 }}}

 The same applies for {{{define-values}}} and {{{define-syntax}}}.

 Bindings introduced by {{{let}}}, {{{let-syntax}}} and friends are handled
 correctly.

-- 
Ticket URL: <http://bugs.call-cc.org/ticket/1132>
CHICKEN Scheme <http://www.call-with-current-continuation.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

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