DoclerLabs / hexMachina

Releases, issues, documentation, website of hexMachina, framework written in Haxe
http://hexmachina.org
MIT License
44 stars 8 forks source link

function binding in flow DSL like in haxe #258

Closed FrancisBourre closed 6 years ago

FrancisBourre commented 6 years ago

Example:

@context
{
    recursive.f3 = sample.testBind.bind( _, i );
    recursive.f4 = hex.mock.Sample.testStaticBind.bind( _, i );

    @public
    binded = sample.testBind.bind( _, i );

    @public
    staticBinded = hex.mock.Sample.testStaticBind.bind( _, i );

    @public
    recursive = new hex.mock.ConstructorWithClosureArgs( sample.testBind.bind( _, i ), hex.mock.Sample.testStaticBind.bind( _, i ) );
    recursive.callWithClosureArgs( sample.testBind.bind( _, i ), hex.mock.Sample.testStaticBind.bind( _, i ) );
    result = hex.mock.ConstructorWithClosureArgs.staticallWithClosureArgs( sample.testBind.bind( _, i ), hex.mock.Sample.testStaticBind.bind( _, i ) );

    @public
    mapping1 = mapping( { fromType: "String->String", toValue: sample.testBind.bind( _, i ) } );

    @public
    mapping2 = mapping( { fromType: "String->String", toValue: hex.mock.Sample.testStaticBind.bind( _, i ) } );

    sample = new hex.mock.Sample();
    i = 3;
}