Download Firefox: WindowsMac OS X
logo       
Google Custom Search
    AddThis Social Bookmark Button

[ sisc-Bugs-1046317 ] shadowing of imports broken: msg#00003

Subject: [ sisc-Bugs-1046317 ] shadowing of imports broken
Bugs item #1046317, was opened at 2004-10-13 16:15
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=379534&aid=1046317&group_id=23735

Category: None
Group: None
Status: Open
Resolution: None
Priority: 7
Submitted By: Matthias Radestock (mradestock)
Assigned to: Nobody/Anonymous (nobody)
Summary: shadowing of imports broken

Initial Comment:
(module
    (bar)
  (define (bar x) #f))
(define (bar x) (if (< x 1) x (bar (- x 1))))
(bar 1) ;;-> #f, should be 0

The problem is that references to imported identifiers
are macro-expanded, rather than handled as ordinary
free references. So in the above example the reference
to bar inside the second function definition is
expanded to an id that is the global id of the bar id
in the module. This is evident when running sc-expand
on the second function:

(#%begin
  ($sc-put-cte 'bar (#%quote (global . bar)))
  (#%define bar
    (#%lambda (|x_0ahUvLDJH|)
      (#%if (< |x_0ahUvLDJH| 1)
        |x_0ahUvLDJH|
        (|@0aV6EXBJH::bar| (- |x_0ahUvLDJH| 1))))))

This appears to be a problem in psyntax.

Note that this issue only arises at the top level,
since in local contexts a duplicate-definition error
would be raised.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=379534&aid=1046317&group_id=23735


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl


<Prev in Thread] Current Thread [Next in Thread>