← Back to team overview

kicad-developers team mailing list archive

Re: Concerns about clearing disagreements before committing.

 

On Thu, Nov 24, 2011 at 11:08:06PM +0400, Vladimir Uryvaev wrote:
>
> 1. Before, I avoided uncontrolled implicit conversions between ints and 
> lengths, which are object to trace. Now, I found, that at this stage I could 
> write cast methods (LENGTH(int) and operator int()), which automatically call 
> comversion between new and old units. So, while code wasn't completely 
> checked, old and new units can live together, without explicit conversion.

Please, that kind of use of casting operator is pretty evil! And anyway
I don't like the idea of a length object, as we obviously decided eons
ago. A length should be an int (or a suitably long int), period. i.e.

typedef long int LENGTH; /* This is a suitable length datatype */

Decide on the length scale and you're set. Even on an algebraic
interpretation a length *is* a scalar, not something else.

> 2. Make VECTOR_PCB type direct replacement to wxPoint, so conversion to 
> wxPoint should be just like with int.

As before, what would be the difference between a VECTOR_PCB and
a wxPoint?

> 3. Then come 'revert' will be done, so code would look as before, without 
> FROM/TO_LEGACY_LU, and should compile and run correctly, and that's the proof 
> that class LENGTH designed correctly.

I don't want a class LENGTH :D

> So after all LENGTH_PCB type can obviously be switched to int, and again, all 
> should work, and then work is done.

Uhm ok, you're talking of prototyping for fixing. I retract the
assertions, then.


-- 
Lorenzo Marcantonio
Logos Srl


References