chicken-janitors
[Top][All Lists]
Advanced

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

Re: [Chicken-janitors] #1615: hidden/gensymed variables are registered f


From: Chicken Trac
Subject: Re: [Chicken-janitors] #1615: hidden/gensymed variables are registered for export
Date: Tue, 07 May 2019 19:09:26 -0000

#1615: hidden/gensymed variables are registered for export
---------------------------------+----------------------------------------
            Reporter:  sjamaan   |      Owner:  sjamaan
                Type:  defect    |     Status:  new
            Priority:  major     |  Milestone:  5.2
           Component:  expander  |    Version:  5.0.0
          Resolution:            |   Keywords:  modules, alias-global-hook
Estimated difficulty:  easy      |
---------------------------------+----------------------------------------
Description changed by sjamaan:

Old description:

> This might cause problems if an interned symbol with the same name is
> defined. Find out if this really is a problem.
>
> Also: alias global hook strikes again ;)

New description:

 This might cause problems if an interned symbol with the same name is
 defined. Find out if this really is a problem.

 Also: alias global hook strikes again ;)

 Example:

 ```
 (module foo (x123)

 (import scheme (chicken syntax))

 (define-syntax define-x123
   (ir-macro-transformer
      (lambda (e i c)
        (let ((name (gensym 'x)))
          `(define ,name 'blah))))

 (define x123 5)

 (define-x123) ;; Should not overwrite the interned version of x123, which
 happens if both collide on foo#x123!
 )

 (import foo)
 (print x123) ;; Should print 5, not blah
 ```

 Of course this requires some fiddling to get the numbers right, which
 would differ per CHICKEN version (a proper test would require reading the
 gensym counter to force the collision, or something like that).

--

--
Ticket URL: <https://bugs.call-cc.org/ticket/1615#comment:2>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

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