Anton
2008-02-23 21:51:23 UTC
Hi all,
I am just interested what is the Pascal way of dealing with
(type) safety and data hiding.
For example, I am writing a module that handles threaded
trees. What should it export?
If I export the definiton of my tree type, I'll disclose my
internals, which is not safe (no data hiding); on the other
hand, if I don't do it, the interface functions will have to
operate with an index or a pointer to indentify a tree inside
my module, which is not type safe...
Doesn't Extended Pascal deal with such problems by offering
restricted types?
Thanks in advance,
Anton
I am just interested what is the Pascal way of dealing with
(type) safety and data hiding.
For example, I am writing a module that handles threaded
trees. What should it export?
If I export the definiton of my tree type, I'll disclose my
internals, which is not safe (no data hiding); on the other
hand, if I don't do it, the interface functions will have to
operate with an index or a pointer to indentify a tree inside
my module, which is not type safe...
Doesn't Extended Pascal deal with such problems by offering
restricted types?
Thanks in advance,
Anton