zen0wu / topcoder-greed

greedy editor for topcoder arena
Apache License 2.0
229 stars 45 forks source link

${Method.ReturnType;ZeroValue} not working in Greed 2.0 Beta. #63

Closed ashashwat closed 10 years ago

ashashwat commented 10 years ago

Instead of ZeroValue, Greed 2.0 beta returns return type.

For SRM 204, D2 1000,

Generated code (class stub)

class MarblesInABag {
    public:
    double
    getProbability(int redCount, int blueCount) {
        return double;
    }
};

Expected code (class stub)

class MarblesInABag {
    public:
    double
    getProbability(int redCount, int blueCount) {
        return 0.0;
    }
};
wookayin commented 10 years ago

Try zeroval instead - a24073f9. It is one of breaking changes (I dont know why changed) and should be documented.

ashashwat commented 10 years ago

@wookayin Thanks, that fixed it. Keeping the issue open for now.

vexorian commented 10 years ago

@shivawu why is the new name preferable? ZeroValue is less abbreviated and more consistent with ReturnType; not to mention that it is going to cause this confusion.

zen0wu commented 10 years ago

Yes, it should be documented. I planned to update the wiki but haven't got time today. zeroval is to keep consistent with the name of string renderer, there're 3 named renderers now, zeroval, parser, and string. What do you guys think?

ashashwat commented 10 years ago

It is consistent with other names, true. But the obvious issue is if people simple try to copy their source template it will break the code. From what I think, generally everyone have their own Template.[cpp|py|cs|java] from earlier version.

I am -0 on this.

wookayin commented 10 years ago

+1 for backward compatibility if possible

zen0wu commented 10 years ago

I think a bit of breaking change is OK. 2.0 has a lot of breaking changes, especially the config schema. I'll put migration guide in the release notes.