Skip to content

Instantly share code, notes, and snippets.

@tanabe
Created December 21, 2011 05:11
Show Gist options
  • Select an option

  • Save tanabe/1504683 to your computer and use it in GitHub Desktop.

Select an option

Save tanabe/1504683 to your computer and use it in GitHub Desktop.
class Animal;
class Human extends Animal;
class Dog extends Animal;
class Bird extends Animal;
move = function(animal:Animal) {
if (animal is Bird) {
animal.fly();
} else {
animal.move();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment