Created
November 16, 2011 01:10
-
-
Save jomontanari/1368957 to your computer and use it in GitHub Desktop.
Seven Languages - IO Day 1
This file contains 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
1 + 1 println | |
(1 + "one") println |
This file contains 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
"Is 0 true" println | |
0 == true println | |
"Is empty string true" println | |
"" == true println | |
"Is nil true" println | |
nil == true println |
This file contains 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
Hobbit := Object clone | |
Hobbit name := "Frodo" | |
Hobbit slotNames println |
This file contains 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
Elf := Object clone | |
Elf name := "Legolas" | |
Elf weapon ::= "Bow and arrow" | |
Elf setWeapon("Sword") | |
Elf weapon println | |
Elf slotNames println |
This file contains 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
Dog := Object clone | |
Dog name := "Harry" | |
Dog bark := method("Woof Woof" println) | |
Dog threwFoodUnderBed := method( i := 0; for(i, 1, 20, bark)) | |
Dog threwFoodUnderBed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment