
I also want to reiterate that area(point) and length(polygon) should be syntax errors. Type safety isn't something we should break lightly.
In your previous reaction you gave the example: Polygon p1; //lots of code if(some condition) { Point p1; //some more code result = something + area(p1); //oops, which p1 did they mean? Is it really so unlikely? }
I agree that such typo's are possible. But why would they only occur for area and length? What about other (generic) operations? Then the syntax error would of course not be found by the compiler. We're building a generic library, where all algorithms apply to all geometries as much as possible. We should not exclude possibilities just because the risk of a typo in implementation. I assume that you have algorithms operating on more than one geometry type alone. Area is not an exception. Regards, Barend