Created
July 21, 2010 21:44
-
-
Save vic/485195 to your computer and use it in GitHub Desktop.
Hello world example in Akin Java
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
# Hello World example in Akin Java | |
# | |
# Akin (http://github.com/vic/akin) | |
package: akin example. | |
# I made imports explicit just to show | |
# how to import classes static members | |
import: java lang String, | |
java lang Runnable, | |
java lang System out | |
# To create a subclass the syntax will be | |
# <ParentClass> class(<Interface>,<Interface2>, <ClassBody>) | |
# If no ParentClass specified, it will be java.lang.Object | |
Hello = class(Runnable): | |
# Akin Java will have type inference | |
final static private hello = "Welcome to Akin" | |
initialize =: @name | |
{Override} run =: | |
5 times(i): out println(i+": "+toString) | |
toString() = "$(hello): $(name)" | |
static main(argv String[]) = new(argv[0]) run | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment