Last active
August 29, 2015 14:09
-
-
Save kichiemon/c4a5f40f852e4d415f5d to your computer and use it in GitHub Desktop.
[Spider]新しい?AltJS「Spider」でHelloWorldを動かしてみる ref: http://qiita.com/iKichiemon/items/202fdfdb13832c67cf11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| npm install -g spider-script |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| spider /path/to/script.spider |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| spider -c /path/to/script.spider |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func Animal(name) { | |
| this.hello = func () { | |
| ::console.log('Hello everyone! My name is \(name) '); | |
| }; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func Cat(name) extends Animal(name) { | |
| this.hello = func () { | |
| super.hello(name); | |
| }; | |
| } | |
| func Dog(name) extends Animal(name) { | |
| this.hello = func () { | |
| super.hello(name); | |
| }; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var cat = new Cat('Kitty'); | |
| var dog = new Dog('Shiba'); | |
| cat.hello(); | |
| dog.hello(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| spider animal.spider |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Hello everyone! My name is Kitty | |
| Hello everyone! My name is Shiba |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| spider -c animal.spider |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment