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
class Main extends unityengine.MonoBehaviour | |
{ | |
function Update() | |
{ | |
unityengine.Debug.Log("Hello"); | |
} | |
} |
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.Context; | |
import haxe.macro.Expr; | |
class EnumAbstractMacro | |
{ | |
public static function build():Array<Field> | |
{ | |
var fields = Context.getBuildFields(); | |
var values = []; |
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
using TypedFieldMacro; | |
typedef A = {?f:Int} | |
class Main | |
{ | |
static function main() | |
{ | |
var a:A = {f:1}; | |
if (a.f.exists()) trace(a.f); |
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
typedef House = | |
{ | |
?numTennants:OptionalField<Int> | |
} | |
class Main | |
{ | |
static function main() | |
{ | |
var house:House = {}; |
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 Reverse.reverse; | |
class Main | |
{ | |
static function main() | |
{ | |
var a = [1,2,3]; | |
for (v in reverse(a)) | |
{ | |
trace(v); |
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
local Anon_mt = { | |
__newindex = function(self, key, value) | |
if value ~= nil then | |
rawset(self, key, value) | |
else | |
self._nils[key] = true | |
end | |
end, | |
__tostring = function(self) |
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.Context; | |
import haxe.macro.Expr; | |
using haxe.macro.Tools; | |
@:enum abstract MyEnum(Int) { | |
var A = 1; | |
var B = 2; | |
var C = 3; | |
} |
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
using StringTools; | |
typedef Build = { | |
target:Target, | |
output:String, | |
classPaths:Array<String>, | |
main:String, | |
debug:Bool, | |
libs:Array<String>, | |
defines:Map<String, String>, |
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
using Unpack; | |
class Main { | |
static function main() { | |
f().unpackInto( [ v1, { a: { length: v2 } }, { a: [ v3, _, v4 ] } ] ); | |
trace(v1); // { a: [ 1 ] } | |
trace(v2); // 2 | |
trace(v3); // 4 | |
trace(v4); // 5 |
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
#if macro | |
import haxe.macro.Context; | |
import haxe.macro.Expr; | |
using haxe.macro.Tools; | |
#end | |
@:enum abstract MyEnum<T>(T) {} | |
typedef A = MyEnum<Float>; | |
typedef B = Array<{a:Int, ?b:Array<{?a:String}>}>; | |
typedef C = Dynamic<Int>; |
OlderNewer