TOM    up http://www.gerbil.org/tom
  similar languages: C   C#   C++   C-Talk   D   Cilk   Java   Objective-C   Pike  
  Description: TOM is a modern, object-oriented programming language. In TOM you can extend an existing class (e.g. overwrite a method) without having the sourcecode and without new compilation. TOM's method-invokations respectively their parameter are similar to those of Smalltalk, because you can give them names. Furthermore, TOM is garbage-collected, has pre- and post-conditions, multiple-inheritance and a C-like syntax.


 Hello World   Michael Neumann
/* Hello World in TOM */

implementation class HelloWorld

   int main Array argv
   {
      [[[stdio out] print "Hello World"] nl];
      return 0;
   }

end;


implementation instance HelloWorld end;
Prints "Hello World" onto the screen.


 Squares   Michael Neumann
implementation class Squares

   int main Array argv
   {
      for( int i=1; i<=10; ++i ) [[stdio out] print (i*i, " ")];
      return 0;
   }
   
end;


implementation instance Squares end;
Outputs the squares from 1 to 10.