[fpc-pascal] private type and type compatibility

Martin lazarus at mfriebe.de
Thu Oct 31 16:14:13 CET 2013


On 31/10/2013 14:41, Frederic Da Vitoria wrote:
>
> ...and this modification would only become relevant for new code, so 
> quite probably not worth the compiler extra code. Yes, I can 
> understand this too. But my question was not about changing the 
> behavior of fpc (not any more). This was a theoretical question. In 
> other words, if you had been in a position to create TP back in 
> nineteen something, and if one of your main concerns had been about 
> respecting the Pascal philosophy, how would you have handled this? The 
> way it has been done? Or do you agree this was not quite orthodox 
> (although efficient)?
>

Well, that depends on how you see a type.

If a type is something that I can use to declare a variable, then the 
"type-information" (for lack of another term) that is part of a typed 
variable is not a "type". Because I can not use it to declare a variable..

So if you differ between type, and type-information then there is no 
conflict.

A typed variable has type info (never mind RTTI, it may just be avail at 
compile time). this type info can be accessed through the variable.

---
Also where is the problem with it?
By making a variable or function's result) public, you declare, that it 
should be usable. So you should expect all indirect requirements to be 
made available too.




More information about the fpc-pascal mailing list