[racket] Encapsulation

From: Ken Hegeland (hegek87 at yahoo.com)
Date: Thu Dec 9 17:33:01 EST 2010

I am working on 39.1.8 of HTDP

I have the gui all set up. The examples in the book use:
(define friends
(make-address-book "friends"))
and then applies friends to the argument, 'add, or 'search.

My thought was a basic list processing function that applies make address-book to each item in the list of strings. But how can I refer to them later in the program?

I thought maybe have the button callback for add/search apply make-address-book to choice-index, this idea worked for adding the name/numbers, but when I try searching it searches empty address-books. Im thinking whats wrong is every application of add creates a new address book and adds the input. Any tips for this problem?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20101209/10e929ce/attachment.html>

Posted on the users mailing list.