Wow, thanks for the insults guys. I didn't realize I was so stupid.

You missed my point too, BTW. According to the link given:

"A constant argument is passed by reference if its size is larger than a pointer."

So you always know what the size of a pointer is? If I have this record:

TMyRec = record
  I: Integer;
end;

Is that passed by value or ref? Is someone compiling on 32-bit or 64? You don't know, and neither does anyone. And that is my point about why having it defined is important.

I can't even remember the last time I used C++. My point in mentioning it was only to demonstrate by analogy what could happen if the same ambiguity present in the Pascal construct was present in other well-known languages.

All the argument that such "bug" could exist with shortstrings and records as well is because nobody can say for sure whether they are supposed to be passed by value or by ref--it could be either. With constref, there is no ambiguity. You know it will be by ref, hence there is no question as to whether it's a bug. Otherwise it's just a matter of opinion.

I guess my brain is way to tiny to get past the notion that a "write once, compile anywhere" programming language should be defined in such a way that the meaning of the program doesn't spontaneously change depending on the compilation platform.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to