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

From: Ryan Culpepper (ryan_sml at yahoo.com)
Date: Sat Feb 25 19:47:00 EST 2006

--- Gregory Woodhouse <gregory.woodhouse at sbcglobal.net> wrote:

> 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
> 5
> 
> 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.
> [...]

The problem wasn't strictness or anything like that. You had the
right idea about what continuation to capture (ie, what point to
escape to) from the beginning.

The problem was that you had

  (lambda () k #f)

instead of 

  (lambda () (k #f))

That is, you had The Right Continuation, but you weren't applying it
to anything.

Ryan



Posted on the users mailing list.