[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 19:16:36 EST 2006

On Feb 25, 2006, at 3:43 PM, Ryan Culpepper wrote:

> You aren't actually applying the continuation in the failure thunk

Well, here's a simple case

 > (define x 4)
 > (let ((y (call/cc (lambda (k) (k 0))))) (set! x 5))
 > x

I had expected that the body of let statement would not have been  
executed, so x would still be 4. But I suppose it's a matter of  
strictness. If, instead, I write

 > (define x 4)
 > ((lambda (y)
       (lambda (k)
         (k 0))))
    (set! x 5))
 > x

I'd expect the lambda expression to be applied to its argument (which  
must be evaluated) regardless of the continuation.

I guess my intuition was just off.

Gregory Woodhouse
gregory.woodhouse at sbcglobal.net

"You must unlearn what you have learned."

Posted on the users mailing list.