Re: [fpc-devel] Class extension

2010-05-28 Thread Joshua Cearley
Speaking of .NET and partial classes, there are also extension methods in newer versions if C# that allow a similar level of bolting methods on to and is likely even simpler to handle than open classes and categories; it amounts to writing a function with a special naming so the compiler kn

Re: [fpc-devel] Class extension

2010-05-20 Thread Matt Emson
Jonas Maebe wrote: Having implemented support for Objective-C/Pascal categories in the compiler, I don't think that this concept can be translated to the (Delphi-compatible) Object Pascal model/implementation. It only works in Objective-C/Pascal because there all dispatching is based on the na

Re: [fpc-devel] Class extension

2010-05-20 Thread Jonas Maebe
On 20 May 2010, at 14:29, Matt Emson wrote: In Objective-C, the Category often seems a lot like the Partial class in a superficial way. It is the same kind of idea - a breaking up of a class in to sections. Sections can be added and removed in a similar way. However the category goes furth

[fpc-devel] Class extension

2010-05-20 Thread Matt Emson
Okay, so the whole Observer Pattern discussion this morning went way off track after I mentioned this idea, but a few people expressed interest in my proposal: I'd rather see a mechanism for injecting first class extensions to existing classes. That way, it really doesn't matter what pattern is