Skip to content

Commit

Permalink
New Io example
Browse files Browse the repository at this point in the history
  • Loading branch information
rtoal committed Apr 1, 2024
1 parent efa2565 commit 7202bb4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions io/cj.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Animal := Object clone
Animal withName := method(name, do(self name := name; self))
Animal speak := method(writeln(self name, " says ", self sound))

Horse := Animal clone
Horse sound := "neigh"

cj := Horse clone withName("CJ")
cj speak

0 comments on commit 7202bb4

Please sign in to comment.