fork download
  1.  
  2. class Alpha(one,two) from Beta(one)
  3. two = two
  4. init
  5. > "Alpha init with ", one, " ", two
  6. end
  7.  
  8. function show()
  9. > "Alpha: ", self.describe()
  10. end
  11.  
  12. function test()
  13. return testMe( self.one, self.two )
  14. end
  15. end
  16.  
  17. class Beta(one)
  18. one = one
  19. init
  20. > "Beta init with ", one
  21. end
  22.  
  23. function show()
  24. > "Beta: ", self.describe()
  25. end
  26. end
  27.  
  28.  
  29. function testMe( one, two )
  30. return "TESTME: " + (one + two)
  31. end
  32.  
  33. inst = Alpha( 1, 2 )
  34. > "Beta show:", inst.Beta.show
  35.  
  36. inst.show()
  37. inst.Beta.show()
  38. > inst.test()
  39.  
  40.  
Success #stdin #stdout 0.01s 6764KB
stdin
Standard input is empty
stdout
Beta init with 1
Alpha init with 1 2
Beta show:Method (Object from Alpha).Beta.show
Alpha: Alpha(){ Beta = Class Beta, one = 1, two = 2}
Beta: Alpha(){ Beta = Class Beta, one = 1, two = 2}
TESTME: 3