Skip to content

Instantly share code, notes, and snippets.

@KirinDave
Created November 8, 2008 20:26
Show Gist options
  • Select an option

  • Save KirinDave/23128 to your computer and use it in GitHub Desktop.

Select an option

Save KirinDave/23128 to your computer and use it in GitHub Desktop.
(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