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
package; | |
import haxe.macro.Expr; | |
class Main { | |
static function main() { | |
var smap:StringMap = ['firstName' => 'Skial', 'lastName' => 'Bainn']; | |
trace( smap.lastName, smap.firstName ); // Bainn, Skial |
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
package; | |
import haxe.macro.Type; | |
import haxe.macro.Context; | |
import haxe.macro.Printer; | |
class Macro { | |
// Runs on class `Test`. | |
public static function build() { |
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
package; | |
import unifill.Utf8; | |
import unifill.InternalEncoding; | |
using unifill.Unifill; | |
/** | |
* ... | |
* @author Skial Bainn |
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
package; | |
import js.node.Net; | |
class Main { | |
static function main() { | |
var server = Net.createServer(function(socket) { | |
socket.write("Echo server\n\n"); | |
socket.pipe(socket); |
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
package js.html; | |
@:native("Blob") | |
extern class Blob | |
{ | |
var size(default,null) : Int; | |
var type(default,null) : String; | |
/** @throws DOMError */ | |
@:overload( function() : Void {} ) |
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
package; | |
@:callable abstract Function<T>(T) from T {} | |
class Main { | |
static function main() { | |
var a:Function<Int->Int> = function(v) return v * v; | |
a(31); | |
} |
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
package; | |
extern class A { | |
@:selfCall public function new(v:String); | |
@:selfCall public function run():Void; | |
} | |
extern class B { |
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
package; | |
import js.html.Blob; | |
class Main { | |
static function main() { | |
var blob1 = new Blob(['<a href="http://haxememes.tumblr.com/post/52244226107/type-inference">Haxe Memes</a>']); | |
var blob2 = new Blob([blob1, '<a href="http://haxememes.tumblr.com/post/98160270445/simon-working-on-haxe">Haxe Memes</a>']); | |
} |
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
package; | |
import python.lib.os.Path; | |
class Main { | |
static function main() { | |
trace( Path.join('C:\\', 'myPath') ); | |
trace( Path.join('C:\\', 'my', 'longer', 'python', 'powered', 'path' ) ); | |
} |
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
package; | |
class Main { | |
static function main() { | |
for (projectile in ['apples', 'oranges']) trace( 'I threw $projectile!' ); | |
} | |
} |