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
(function($ctx) { | |
var $empty = function () { return function () {} }; | |
var $estr = function () { return $ctx.Std.string(this) }; | |
var $array = function (args, from, to) { return Array.prototype.slice.call(args, from, to); }; | |
var $copy = function (from, to, overwrite) { for (var id in from) if (overwrite || (to[id] == null)) to[id] = from[id]; return to; }; | |
var $c = function (s, c) { return { c: c, toString : function () { return s; }}}; | |
var $init = []; | |
var $enum = function (path, constructs) { | |
this.__ename__ = path; | |
var c = this.__constructs__ = []; |
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
extern class Server {} | |
extern class ServerAPI implements TinkExt<Server> { | |
@:native listen(port:Int, ?hostname:String, ?handler:Server->Void);//when no type is defined, the target itself is returned | |
@:native(listen) listenToPath(path:String, ?handler:Server->Void);//both identifiers and strings are allowed to define native names | |
@:event request(request:ServerRequest, response:ServerResponse); | |
@:event(connection) socketInbound(socket:Socket); | |
} | |
//The above will now be expanded to: | |
extern class ServerAPI implements TinkExt<Server> { |
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 ; | |
using tink.macro.tools.MacroTools; | |
import tink.macro.tools.AST; | |
import haxe.macro.Expr; | |
class Main { | |
static function main() { | |
var f = test1(); |
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.FastList; | |
import haxe.Timer; | |
import tink.util.Benchmark; | |
import tink.util.ChunkIter; | |
import FL; | |
using tink.util.ChunkIter; | |
class IterTest { |
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
import haxe.macro.Expr; | |
import haxe.macro.Context; | |
class MacroLambda | |
{ | |
public static function main(): Void | |
{ | |
trace('Hello World'); |
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 ; | |
using Tag; | |
class Main | |
{ | |
static function main() | |
{ | |
var t = "div".tag().att("id", "container") | |
.child("a".tag().att("href", "http://www.haxe.org") |
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 flash.display.DisplayObjectContainer; | |
import flash.events.Event; | |
import flash.Lib; | |
import flash.text.TextField; | |
import flash.text.TextFieldAutoSize; | |
import flash.text.TextFieldType; | |
import haxe.PosInfos; | |
import haxe.Timer; |
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 tink.lang.Cls; | |
class X implements Cls { | |
@:read var msg:String = _; | |
} | |
class Y implements Cls { | |
@:forward @:read var x:X = _; | |
} | |
class Main { |
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 tink.lang.Cls; | |
class LevelSpec implements Cls { | |
@:read var x:Float = _; | |
} | |
class RunningLevel implements Cls { | |
@:forward var spec:LevelSpec = _; | |
} |
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 tink.lang.Cls; | |
class Foo<T> { | |
public var owner:T; | |
public function new() { | |
} | |
} | |
class Param { | |
} | |
class Main<T> implements Cls { |
OlderNewer