Skip to content

Instantly share code, notes, and snippets.

@iwillspeak
Created November 2, 2012 09:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iwillspeak/3999660 to your computer and use it in GitHub Desktop.
Save iwillspeak/3999660 to your computer and use it in GitHub Desktop.
Sketch of the class syntax for Leet
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