Opened 8 years ago

Last modified 4 months ago

#1286 new enhancement

define-constant and define-inline should shadow imported identifiers

Reported by: evhan Owned by:
Priority: minor Milestone: 6.0.0
Component: compiler Version: 4.10.x
Keywords: modules, inlining, define-inline, define-constant Cc:
Estimated difficulty: hard

Description

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.

Change History (6)

comment:1 Changed 8 years ago by sjamaan

Estimated difficulty: hard

comment:2 Changed 6 years ago by felix winkelmann

Milestone: 5.05.1

comment:3 Changed 5 years ago by sjamaan

Milestone: 5.15.2

Getting ready for 5.1, moving tickets which won't make it in to 5.2.

comment:4 Changed 5 years ago by felix winkelmann

Milestone: 5.25.3

comment:5 Changed 3 years ago by sjamaan

Milestone: 5.35.4

comment:6 Changed 4 months ago by felix winkelmann

Milestone: 5.46.0.0
Note: See TracTickets for help on using tickets.