by Bram Moolenaar
Static, object-oriented language by the author of vim.

Zimbu is an experimental programming language. It is a very practical, no-nonsense kind of language. It mixes the good things of many existing languages and avoids their deficiencies. And then throws in a few brand new ideas.

CLASS Animal
  PROC $eat() @default
    IO.print("I eat like a generic Animal.")
  }
}
 
CLASS Wolf EXTENDS Animal
  PROC $eat() @replace
    IO.print("I eat like a wolf!")
  }
}
 
CLASS Fish EXTENDS Animal
  PROC $eat() @replace @default
    IO.print("I eat like a fish!")
  }
}
 
CLASS GoldFish EXTENDS Fish @final
  PROC $eat() @replace
    IO.print("I eat like a goldfish!")
  }
}
 
CLASS OtherAnimal EXTENDS Animal
}
 
FUNC Main() int
  list<Animal> animals = NEW()
  animals.add(Animal.NEW())
  animals.add(Wolf.NEW())
  animals.add(Fish.NEW())
  animals.add(GoldFish.NEW())
  animals.add(OtherAnimal.NEW())
 
  FOR a IN animals
    a.eat()
  }
  RETURN 0
}
Information updated 08/28/15
View Comments