<br><br><div class="gmail_quote">On Fri, Nov 26, 2010 at 11:42 AM, Max Vlasov <span dir="ltr"><<a href="mailto:max.vlasov@gmail.com">max.vlasov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>An idea here is to introduce a directive (maybe something else, but directive looks more straightforward), let's call it readonly that forces the method to be able only to read the fields and properties of the object it belongs to and forbid any writing. Sure in this case it only can call only the methods also containing such directive. <br>


<br></blockquote></div><br>Also, one note to consider <br>It is know that some of OOP concepts can be implemented with procedural language. For example, pseudo-encapsulation with the records. Ironically, this idea can be implemented using the emulation.<br>

<br>Compare<br><br>procedure MyObjFind(var Rec: TMyObjData) with <br>procedure MyObjFind(const Rec: TMyObjData)<br><br>the latter is actual readonly emulation, you won't be able to change anything and you won't be able to pass this record by reference to any other procedure<br>

<br>Max Vlasov<br>