Created
November 8, 2008 20:26
-
-
Save KirinDave/23128 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (class object% | |
| (init size) ; initialization argument | |
| (define current-size size) ; field | |
| (super-new) ; superclass initialization | |
| (define/public (get-size) | |
| current-size) | |
| (define/public (grow amt) | |
| (set! current-size (+ amt current-size))) | |
| (define/public (eat other-fish) | |
| (grow (send other-fish get-size)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment