<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 30/10/2013 13:30, Xiangrong Fang
wrote:<br>
</div>
<blockquote
cite="mid:CAP93jB25+FvhE2a2dtY+VfohQA5=PR0uMCEH2c+4c=r14H9QCQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">2013/10/30 Jonas Maebe <span
dir="ltr"><<a moz-do-not-send="true"
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>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
I think there is no problem with: <br>
<br>
var <br>
a: array of Integer<br>
begin<br>
A:= obj.proc; <br>
<br>
You are NOT using the type. You are using the value. <br>
<br>
<br>
</body>
</html>