<div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">Ryan Joseph <<a href="mailto:ryan@thealchemistguild.com">ryan@thealchemistguild.com</a>> schrieb am Mo., 3. Juni 2019, 16:36:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I found a restriction in properties which is a little disappointing. I get there’s probably some objective of safety but Pascal is a direct memory access language so I don’t understand why properties have this unique restriction when I could do the same thing using functions (pointers can’t be dereferenced in properties either). Shouldn’t I as the programmer get to decide whether the property is safe or not based upon when I call it?<br>
<br>
type<br>
TB = class<br>
x: integer;<br>
end;<br>
<br>
type<br>
TA = class<br>
private<br>
b: TB;<br>
public<br>
property x: integer read b.x; // ERROR: Must be a record/object type<br>
end;<br></blockquote></div><div dir="auto"><br></div><div dir="auto">The b field could be Nil and the class might not provide any functionality to check for that. In addition to that it's an additional indirection while records/objects merely require an offset. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div>