<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2013/10/30 Jonas Maebe <span dir="ltr"><<a href="mailto:jonas.maebe@elis.ugent.be" target="_blank">jonas.maebe@elis.ugent.be</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The tdynarray type is not visible in the program because u1 is not in its uses clause (it's not in scope whatsoever), and nevertheless there is no problem to use it. It's of course not exactly the same (tdynarray isn't declared as private to u1), but at the scope visibility level it is the same situation as far as I am concerned.<span class="HOEnZb"></span></blockquote>
<div><br><div class="gmail_default" style="font-family:courier new,monospace;display:inline">I don't think they are the same. tdynarray</div> is not usable in main program because you did not uses u1, NOT because the type is defined as PRIVATE!<br>
<br><div class="gmail_default" style="font-family:courier new,monospace">As a matter of fact, if you define tdynarray as private (not in interface section), there is no way you can use it as a return type of an exported (public) function. This is a very consistent scoping rule!<br>
<br></div><div class="gmail_default" style="font-family:courier new,monospace">In my example, if the code is like this:<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">generic TVector<T> = class<br>
private type<br></div><div class="gmail_default" style="font-family:courier new,monospace"> TDataType = array of T;<br>private<br> function proc: TDataType;<br></div><div class="gmail_default" style="font-family:courier new,monospace">
end;<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">Then I think it is ok, because this PRIVATE type is used by PRIVATE function.<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">
What do you think?<br><br></div><div class="gmail_default" style="font-family:courier new,monospace">Sincerely,<br></div><div class="gmail_default" style="font-family:courier new,monospace">Xiangrong<br></div></div></div>
</div></div>