Skip to content

Instantly share code, notes, and snippets.

@kichiemon
Last active August 29, 2015 14:09
Show Gist options
  • Select an option

  • Save kichiemon/c4a5f40f852e4d415f5d to your computer and use it in GitHub Desktop.

Select an option

Save kichiemon/c4a5f40f852e4d415f5d to your computer and use it in GitHub Desktop.
[Spider]新しい?AltJS「Spider」でHelloWorldを動かしてみる ref: http://qiita.com/iKichiemon/items/202fdfdb13832c67cf11
func Animal(name) {
this.hello = func () {
::console.log('Hello everyone! My name is \(name) ');
};
}
func Cat(name) extends Animal(name) {
this.hello = func () {
super.hello(name);
};
}
func Dog(name) extends Animal(name) {
this.hello = func () {
super.hello(name);
};
}
var cat = new Cat('Kitty');
var dog = new Dog('Shiba');
cat.hello();
dog.hello();
npm install -g spider-script
spider /path/to/script.spider
spider -c /path/to/script.spider
func Animal(name) {
this.hello = func () {
::console.log('Hello everyone! My name is \(name) ');
};
}
func Cat(name) extends Animal(name) {
this.hello = func () {
super.hello(name);
};
}
func Dog(name) extends Animal(name) {
this.hello = func () {
super.hello(name);
};
}
var cat = new Cat('Kitty');
var dog = new Dog('Shiba');
cat.hello();
dog.hello();
spider animal.spider
Hello everyone! My name is Kitty
Hello everyone! My name is Shiba
spider -c animal.spider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment