| ▲ | magicalhippo 2 hours ago | ||||||||||||||||
But you don't need to specify a GUID for an interface in Delphi, and Blaise uses ARC for both objects and interfaces. | |||||||||||||||||
| ▲ | vintagedave an hour ago | parent [-] | ||||||||||||||||
True! But here at least Blaise is consistent. It’s not mixing models. My real wish for Pascal interfaces is that they are pure. Some of that is not bringing in COM stuff (including recounting) because I think memory management is or should be different to interface-based clean coding. Another: In Delphi if you define a property in an interface, you have to bring in the getter and setter too. And that makes them implicitly public / visible (even if the implementing class declares them as private.) And they must be methods, there’s no way to say “read, but I don’t care how” (where Delphi can normally read fields too.) In other words, the semantic of “I want a property with read access” causes the interface contract to define the implementation, including making public the normally private / internal backing. Whereas what I really want is to declare “property Foo: Integer read;” and the interface requires that is satisfied, but not how. In other words, interfaces are pure - they don’t bring in extra baggage. You can do that in Oxygene. | |||||||||||||||||
| |||||||||||||||||