← Back to team overview

coapp-developers team mailing list archive

Updates to property sheets

 

At the request of Tim, I've done some tweaking of the lambda expression support in propertysheets (so, pTk and Autopackage files)

Previously, you could expand out a collection as a collection of key/value pairs via a template:

#define {
    colors: {
        "red" , "green"
    };
};

someRule {
    someProperty : {
         colors => "label" = "value is ${each}";
    };

    someotherProperty : {
         colors => "label-${each}" = "value is ${each}";
    };
};


which would expand out to:

someRule {
    someProperty : {
        "label" =  {
            "value is red",
            "value is green"
        };
    };
    someotherProperty : {
        "label-red" = "value is red";
        "label-green" = "value is green";
    };
};

Now, I've enhanced the collection support so that it can take multiple collections :

#define {
    platforms: {
        x86 , x64
    };
    compilers: {
        vc7 , vc8, vc9
    };

};

someRule {
    someProperty : {
        (compilers, platforms)  => "permutations" = "do something with compiler=${0} and platform=${1}";
    };
};

which would expand out to:

someRule {
    someProperty : {
        permutations =  {
            "do something with compiler=vc7 and platform=x86",
            "do something with compiler=vc8 and platform=x64",
            "do something with compiler=vc9 and platform=x86",
            "do something with compiler=vc7 and platform=x64",
            "do something with compiler=vc8 and platform=x86",
            "do something with compiler=vc9 and platform=x64",

        };
    };
};

It can multiplex multiple collections, and

Tim will likely have a field day simplifying the .buildinfo files with this, and that will help explain how it's useful...

Oh, and I've made trailing semicolons after a close brace { optional.

G