Permalink
Browse files

New example: OOP

  • Loading branch information...
1 parent 4686e1e commit a5178eb9f56c6ed705809ffb1b2cee4c17136c0e @singpolyma committed Mar 18, 2010
Showing with 16 additions and 0 deletions.
  1. +16 −0 examples/oop.rpnr
View
@@ -0,0 +1,16 @@
+# Playing around with OOP
+
+Animal Class nil :new =
+ Animal 'initialize' 'name'
+ @name name =
+ :lambda , :define_method
+ Animal 'name' :attr_accessor
+
+Dog Class Animal :new =
+ Dog 'speak' 'n'
+ n ('i' "Woof!" nil :puts :lambda) :times
+ :lambda , :define_method
+
+adog Dog "Rufus" :new =
+adog nil :name nil :puts
+adog 2 :speak

0 comments on commit a5178eb

Please sign in to comment.