DelphiTools – Object Pascal does allow binding a property to a field for direct read/writer, but we all have seen properties that required a slightly more complex getter or setter, and that usually meant a method for both. DWScript (svn trunk) & Smart Pascal (1.1) now support property expressions and statements, so the syntax is extended to allow: property Name : Type read (expression) write (expression|statement) Under the hood, the compiler will generate an unnamed getter or setter method when appropriate. Let’s take f.i. a class that exposes an internal list, you can now use just TMyClass = ...
Visits by Source
Users who voted for this posting
Jørn E. Angeltveit