Created
November 2, 2012 09:13
-
-
Save iwillspeak/3999660 to your computer and use it in GitHub Desktop.
Sketch of the class syntax for Leet
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
module sample | |
import io | |
/** | |
* Greeting class. | |
* | |
* Stores a list of greetings and prints them to the | |
* screen upon request | |
*/ | |
class SampleGreeter { | |
-String[] greetings = []; | |
initialise(String[] greetings) { | |
this.greetings = greetings; | |
} | |
+@Null doGreeting() { | |
foreach (String greeting in this.greetings) { | |
io.print(greeting); | |
Number stringValue = num(greeting); | |
} | |
} | |
} | |
// Create a new greeter with the traditional text | |
SampleGreeter greeter = new SampleGreeter(["Hello", "World!"]); | |
// Hello World! | |
greeter.doGreeting(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment