RealyUniqueName / haxe

Haxe - The Cross-Platform Toolkit

Home Page:http://haxe.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Special class for PHP syntax implementation

RealyUniqueName opened this issue · comments

To completely remove untyped stuff from std lib we need generator to be able to generate special PHP syntax cases.

E.g.

extern class PHP {
    //generates (int)$value
    static function int(value:Dynamic):Int; 
    //generates (float)$value
    static function float(value:Dynamic):Float; 
    //generates (string)$value
    static function string(value:Dynamic):String; 
    //generates (bool)$value
    static function bool(value:Dynamic):Bool; 
    //generates $value instanceof $phpClassName
    static function instanceof(value, phpClassName):Bool 
    /*
        PHP.foreach(collection, function(key, value) trace(key, value));
        generates:
        foreach($collection as $key => $value) {
            trace($key, $value);
        }
    */
    static function foreach(collection:Dynamic, body:Dynamic->Dynamic->Void):Void;     
// etc
}

Implemented in 3aeb165