<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 01.11.2015 16:38, Jonas Maebe wrote:<br>
</div>
<blockquote cite="mid:563631EA.1050809@elis.ugent.be" type="cite">1)
do you a) forbid an enumerator specification if the class already
has an enumerator</blockquote>
No, it's not needed.<br>
<blockquote cite="mid:563631EA.1050809@elis.ugent.be" type="cite">b)
hide the existing enumerator</blockquote>
No, it's not needed.<br>
<blockquote cite="mid:563631EA.1050809@elis.ugent.be" type="cite">or
c) allow enumerating both via the property and the original class
enumerator?</blockquote>
There can never be a situation where property and class enumerators
compete. property enumerator is by design allowed only for array
properties:<br>
<b>property A[index: xyz]</b>. They cannot introduce an enumerator
with current trunk.<br>
<blockquote cite="mid:563631EA.1050809@elis.ugent.be" type="cite">
If you all both, how do you differentiate? If b), first assigning
the property to a variable</blockquote>
You cannot assign an array property to a variable. It does not exist
without the index parameter.<br>
<blockquote cite="mid:563631EA.1050809@elis.ugent.be" type="cite">
and iterating over that will have a different result than directly
iterating over the property, which is bad for understandability
and code predictability.</blockquote>
This can never happen. Array property does not exist without the
index parameter.<br>
<br>
---<br>
You probably missed the fact that property enumerator can be
introduced only for array properties. I talk about it in the issue
report <a class="moz-txt-link-freetext" href="http://bugs.freepascal.org/view.php?id=28820">http://bugs.freepascal.org/view.php?id=28820</a> :<br>
<i><br>
Please note that the "enumerator" keyword can be used only for
"array" properties because normal properties can have a default
enumerator defined.</i><br>
<br>
Also the patch I uploaded is written in regard to this design. See
in project1.lpr (uncomment the enumerator keyword for testing):<br>
<b> property MyString: string read GetMyString;// enumerator
GetEnumerator2; // <-- try to uncomment, this has to fail to
compile (correct) !</b><b><br>
</b><br>
<br>
Ondrej<br>
</body>
</html>