[racket] confusion about shadowing predefined functions in interactions window

From: Dan Grossman (djg at cs.washington.edu)
Date: Tue Oct 23 11:48:35 EDT 2012

Thanks, David.  I would be interested in someone walking through how this
behavior arises -- as well as the design issue regarding the "hopeless
top-level": Is this the least-bad option available or an unexpected
consequence?

--Dan

On Mon, Oct 22, 2012 at 7:30 PM, David Van Horn <dvanhorn at ccs.neu.edu>wrote:

> 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
>
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/**users <http://lists.racket-lang.org/users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20121023/437c8469/attachment-0001.html>

Posted on the users mailing list.