## OTalk

Here it is, OTalk Version 0.0.0.1

An experimental programming language with relations to SMALLTALK, PYTHON, C++, MAGIK ...

Class Exemaples

- Integer: Instances of class Integer represents integer values in the range of -2**29 to 2**29-1.
- Object: The universal superclass.
- Snapshot of class hierarchy:

          Object
          |
          +-- Boolean
          |   |
          |   |
          |   +-- True
          |   |
          |   +-- False
          |
          +-- Slotted
              |
              +-- Collection
                  |
                  ..

Syntax Exemaples

Calculating faculty

      Integer.fak
          if self.eq(0)
          then
      	^1
          else
      	^self * (self - 1).fak
          endif

Calculating faculty (sequential version)

      Integer.fak
          |res c|
          res = 1;
          c = self;
      	while (c > 1)
             res = res * c;
             c = c - 1
          end;
          ^res

Value at a key in a dictionary

      Dictionary.at(key)
          |i|
          i = self.indexFor(key);
          if i.eq(nil) then
              ^nil
          else
      	^values.at(i)
          endif

Method for calculatin index for a key

      Dictionary.indexFor(key)
          |i|
          i=0;
          # And now a really poor implementation.
          while (i < size) # Size is the instance variable size
              if keys.at(i).eq(key)
          	then
      	    ^i
          	endif;
          	i = i + 1
          end;
          ^nil

Every class library designer recognizes following:

      True.||(other)
      	^self

      True.or(other)
      	^self

      True.&(other)
      	^other

      True.and(other)
      	^other

      True.not
      	^false

Olaf Sylvester, Dec 1998