(defobject silly ())

(defobject billy ())

(defobject willy ())

(defobject foo (silly willy)
  (property p1 1 p2 2 p3 3)
  (shared-property sp1 11 sp2 22))

(defobject bar (billy willy)
  (property p4 4 p5 5)
  (shared-property sp3 33))

(defmethod (foo 'hi x y)
  (print newline (+ (getp self 'p1) x))
  (print newline (+ (getp self 'sp1) y))
  (call-next-method)
  (print newline "Got back")
  self)

(defmethod (bar 'bye x y)
  (print newline (- (getp self 'p4) x))
  (print newline (- (getp self 'sp3) y))
  self)

(defmethod (willy 'hi x y)
  (print newline "willy here, x=" x ", y=" y))

(article the that)
(synonym small tiny)

(defobject gag (foo)
  (noun chicken chick)
  (adjective big red)
  (property p2 baz))

(defobject baz (foo bar)
  (noun dog pup)
  (adjective small black)
  (property p1 111
	    p2 gag
	    p4 222))

(define (main)
  (print newline (fact 10))
  (let ((x (baz 'hi 3 5)))
    (print newline x))
  (let ((x (baz 'bye 3 5)))
    (print newline x)))

(define newline "
")
  
(define (fact n)
  (if (< n 1) 1
    (* n (fact (- n 1)))))
