[fpc-devel] Re: [fpc-l] type discussion

Gerhard Scholz gs at g--s.de
Wed Jun 1 20:03:06 CEST 2005


my marks start with ####:

----- Original Message -----
From: "Ales Katona" <ales at chello.sk>
To: "FPC developers' list" <fpc-devel at lists.freepascal.org>
Sent: Wednesday, June 01, 2005 6:52 PM
Subject: Re: [fpc-devel] Re: [fpc-l] type discussion


> Gerhard Scholz wrote:
>
> >>>           var
> >>>             x : type1,  y : type2 ;
> >>>
> >>>           x *:= y ;
> >>>
> in my humble opinion(IMHO):
#### thanks for the explanation
>
> := is based on the fact that A: is written normaly in math etc. where it
> means " this is a fact about A "
> So when someone writes A:=5; it means "it's a fact that A equals 5"
#### fine, but in programming ":=" usually means "becomes"
> Writing A*:= is stupid. If nothing else do it like this:
> A:*=
> But IMHO it's useless in ANY case. Even C people tend to not use it when
> they want readible code(especialy * which is so ambiguos)
#### the star "*" here just was an an example for any operator, could have
been +, / or AND or whatever
>
> As to the ASM:
>
> in C if you do a+=b; and a is int b is longint it does this actualy:
> a = a + (int)b;
>
> which is stupid and unsafe.

#### I do not see this is an argument.
var a:integer; b:longint; sb : integer ;
  {1} a += b ;
  {2} a := a + b ;
  {3} sb := b ; a+=sb ;
All three versions produce the same nonsense. To avoid such nonsense I like
the compiler checks (range on, overflow on, stack overflow on, ioerror on).
####

>
> Just my 0.05 euros






More information about the fpc-devel mailing list