Don't like ads? PRO users don't see any ads ;-)
Guest

Early testing of my programming language

By: Zotoaster on Dec 7th, 2011  |  syntax: Groovy  |  size: 0.34 KB  |  hits: 95  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function main()
  2. {
  3.         var test:Foo;
  4.        
  5.         var ptest:System.IRunnable* = &test;
  6.         ptest->Run();
  7. }
  8.  
  9. package System
  10. {
  11.         interface IRunnable
  12.         {
  13.                 function Run();
  14.         }
  15. }
  16.  
  17. class Foo [System.IRunnable]
  18. {
  19.         function Run()
  20.         {
  21.                 print "hello";
  22.         }
  23. }
  24.  
  25. class Bar [System.IRunnable]
  26. {
  27.         var x = "goodbye";
  28.        
  29.         function Run()
  30.         {
  31.                 print x;
  32.         }
  33. }
  34.