On 06 Mar 2008, at 22:22, Vincent Snijders wrote:

Peter Vreman schreef:

1. It is passed by value and not by reference.

The compile could decide to pass by reference, couldn't it.

That's what it did in the past, but that's a hack (because it's passing a value without an address by reference).

2. You don't know the size of the value.

The caller knows the size, doesn't it.

No, it doesn't. Ordinal constants have no inherent size in Pascal (well, in case of TP/Delphi and therefore FPC: most of the time, at least).

Why do you need to know the size?

E.g. on big endian, the memory layout of byte(1), word(1), cardinal(1) and qword(1) is completely different.


Jonas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to