On Wed, 19 Nov 2014 13:47:50 +0000 Don via Digitalmars-d <[email protected]> wrote:
> > yes. besides, there is no such thing as "negative length", so > > it's > > somewhat... weird to use signed integer for length. > > A length can certainly be negative. Just as a bank balance can be > negative. It's just a number. what is the relation between bank balance and length? please, show me the array with -1 element, so i can see negative length myself. seems to me that you are using "length" as "quantity", but that isn't right. > If I have two pencils of length 10 cm and 15 cm, then the first > one is -5 cm longer than the other. and again "length" is not a relation. show me pencil of length -10 cm. when you substractin lengthes, you got completely different type as a result, not "length" anymore. ah, that untyped real-life math! ;-) > Of course any physical pencil is always of positive length, but > that doesn't mean that typeof(pencil.length) can never be > negative. it can't be negative. if it can be negative, it is wrongly named, it's not "length".
signature.asc
Description: PGP signature
