[plt-scheme] Checking to see if a key is present in a hash table

From: Gregory Woodhouse (gregory.woodhouse at sbcglobal.net)
Date: Sat Feb 25 20:15:44 EST 2006

On Feb 25, 2006, at 4:47 PM, Ryan Culpepper wrote:

>
> The problem wasn't strictness or anything like that.

I don't doubt you, but what I had in mind was  something like this

(define x 0)
(define (f)
(let ((y
        (call/cc
         (lambda (k)
           k 0))))
   (set! x 1)))

If I call f, x will be set to 1. Now, my reasoning (one hopes, not in  
the manner of Louis Reasoner!) was that f is really equivalent to f2

(define (f2)
   ((lambda (y)
      (call/cc
       (lambda (k)
         k 0)))
    (set! x 1)))

Now, there, it seems that y ought to be bound to the result of (set!  
x 1) before the continuation is ever invoked. But I can imagine a non- 
strict evaluation strategy under which it is determined that y will  
be bound to 0 before (set! x 1) is invoked, so x remains bound to 0.



===
Gregory Woodhouse
gregory.woodhouse at sbcglobal.net

"Not only is the universe stranger than we
imagine: it is stranger than we can imagine."
--Sir Arthur Eddington




Posted on the users mailing list.