Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

O'Scheme

Name: Anonymous 2008-07-01 16:00


(class (Cat)
    (property age)
    (property name)
    (property weight)

    (define (constructor name age weight)
        (self name name)
        (self age age)
        (self weight weight))

    (define (display)
        (display "<Cat named ")
        (display (self name))
        (display ">")
        (newline)))

(let ((cat (Cat "Kitty" 7 10)))
    (cat display))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List