chicken-janitors
[Top][All Lists]
Advanced

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

[Chicken-janitors] #1286: define-constant and define-inline should shado


From: Chicken Trac
Subject: [Chicken-janitors] #1286: define-constant and define-inline should shadow imported identifiers
Date: Sun, 22 May 2016 05:28:29 -0000

#1286: define-constant and define-inline should shadow imported identifiers
-------------------------------------------------+-------------------------
 Reporter:  evhan                                |      Owner:
     Type:  enhancement                          |     Status:  new
 Priority:  minor                                |  Milestone:  5.0
Component:  compiler                             |    Version:  4.10.x
 Keywords:  modules, inlining, define-inline,    |
  define-constant                                |
-------------------------------------------------+-------------------------
 The following should print {{{yes}}} rather than the procedure
 {{{exact}}}:

 {{{
 (use (only data-structures exact))
 (define-constant exact 'yes)
 (print exact) ; => #<procedure (numbers#inexact->exact x1007)> instead of
 'yes
 }}}

 The same applies for {{{define-inline}}}:

 {{{
 (use (only numbers exact))
 (define-inline (exact n) 'yes)
 (print (exact 1.0)) ; => 1 instead of 'yes
 }}}

 This happens because variables are module-resolved (via {{{lookup}}}
 against the current environment) in {{{resolve-variable}}} before they're
 keyed into the constant and inline tables. I think the raw identifier
 should be used when looking up inlined and constant idenfifiers instead
 ({{{x0}}} rather than {{{x}}}), but haven't looked too deeply at this
 issue yet.

--
Ticket URL: <http://bugs.call-cc.org/ticket/1286>
CHICKEN Scheme <http://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]