Created
December 7, 2014 14:36
-
-
Save skial/7a03271b6612274f348e to your computer and use it in GitHub Desktop.
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
-main Main | |
-js test.js | |
--next | |
-cmd node test.js |
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
package ; | |
/** | |
* ... | |
* @author Skial Bainn | |
*/ | |
class Main { | |
public static function main() new Main(); | |
public function new() { | |
var a:Thing = Thing.A; | |
var b:Thing = Thing.B; | |
var c:Thing = 3; | |
print(a); | |
print(b); | |
print(c); | |
} | |
public function print(v:Int):Void { | |
switch (v) { | |
case Thing.A: trace('A'); | |
case Thing.B: trace('B'); | |
case _: trace('unknown'); | |
} | |
} | |
} | |
@:enum abstract Thing(Int) from Int to Int { | |
public var A = 1; | |
public var B = 2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment