[racket] confusion about shadowing predefined functions in interactions window

From: David Van Horn (dvanhorn at ccs.neu.edu)
Date: Mon Oct 22 22:30:36 EDT 2012

On 10/22/12 10:05 PM, Dan Grossman wrote:
> (define (range lo hi)
>      (print "hi")
>      (if (> lo hi) null (cons lo (range (+ 1 lo) hi))))
...
> I apologize if this is a known "feature" or a known "bug" -- I do scan
> the release notes briefly when new versions come out, but don't remember
> anything about this.  Any pointers?  Thanks!

Because I can't do it justice, I will let someone else provide the 
answer as to why this does what it does (which is an instance of "the 
top-level is hopeless"), but I just want to point out that I showed this 
example to two members of the PLT team and asked them to predict how 
many times "hi" would be printed.

They both predicted wrong.

David


Posted on the users mailing list.