chicken-janitors
[Top][All Lists]
Advanced

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

[Chicken-janitors] Re: #445: define-record doesn't respect scope rules


From: Chicken Trac
Subject: [Chicken-janitors] Re: #445: define-record doesn't respect scope rules
Date: Thu, 09 Dec 2010 17:15:47 -0000

#445: define-record doesn't respect scope rules
----------------------+-----------------------------------------------------
  Reporter:  mario    |       Owner:       
      Type:  defect   |      Status:  new  
  Priority:  major    |   Milestone:  4.7.0
 Component:  unknown  |     Version:  4.6.x
Resolution:           |    Keywords:       
----------------------+-----------------------------------------------------

Comment(by syn):

 The above code expands to this:

 {{{
 (##core#let
   ()
   (##core#begin
     (##core#set!
       make-foo
       (##core#lambda (bar) (##sys#make-structure (##core#quote foo) bar)))
     (##core#set!
       foo?
       (##core#lambda (x) (##sys#structure? x (##core#quote foo))))
     (##core#begin
       (##core#set!
         foo-bar-set!
         (##core#lambda
           (x val)
           (##core#check (##sys#check-structure x (##core#quote foo)))
           (##sys#block-set! x 1 val)))
       (##core#set!
         foo-bar
         (##core#lambda
           (x)
           (##core#check (##sys#check-structure x (##core#quote foo)))
           (##sys#block-ref x 1))))))
 }}}

 This suggests that {{{(let () (begin (define foo 1)}}} which expands to
 {{{(##core#let () (##core#begin (##core#set! foo 1)))}}} would also leak
 the {{{foo}}} binding but somehow this is not the case.

-- 
Ticket URL: <https://bugs.call-cc.org/ticket/445#comment:1>
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]