Skip to content

Class tannus.io.Getter

Ryan Davis edited this page Aug 1, 2015 · 1 revision

abstract Getter<T> from T->Void


var v : T

The return value of this Getter

function get():T

Invokes this Getter, and returns it's value

static macro function create<T>(e : ExprOf<T>):ExprOf<Getter<T>>

Macro for creating Getters


Usage Example

    package ;
    import tannus.io.Getter
    class Main {
        /* Executed with the command-line argument 'Hello' */
        public static function main():Void {
            var args = Sys.args();
            var first:Getter<String> = Getter.create(args[0]);
            
            trace( first ); // 'Hello'
        }
    }