<p><br>
On Mar 6, 2011 3:37 PM, "Michel Fortin" <<a href="mailto:michel.fortin@michelf.com">michel.fortin@michelf.com</a>> wrote:<br>
><br>
> Le 2011-03-06 à 17:51, Benjamin Shropshire a écrit :<br>
><br>
> > On 03/06/2011 01:14 PM, Michel Fortin wrote:<br>
> >> Le 2011-03-06 à 14:10, Don Clugston a écrit :<br>
> >><br>
> >>> OTOH I don't know what to about the const(Object) ref pull request.<br>
> >>> That will definitely take a long time to evaluate.<br>
> >> Indeed, and I don't expect it to be integrated as fast as a normal pull request. It's fine for a more complicated patch to take longer to review. Don't hesitate to merge smaller ones first even if mine is older. Still, I hope someone looks at it eventually.<br>

> >><br>
> >> Also, this pull request is small relatively to what I'm preparing regarding integration of the Objective-C object model as extern(Objective-C). In a way you could say I'm testing the process with this smaller one first.<br>

> ><br>
> > Given that we now have three(?) extern(Foo)'s in play (if not in the official version), should the API of what an extern looks like be formalised? Might it even be done so that unofficial support for other languages could be implemented as SO/DLL's without needing to rebuild dmd<br>

><br>
> Great idea. Unfortunately, it can't be done with DMD as we have now. For one thing, DMD would need to represent different linkage with different classes which could be registered dynamically at runtime, currently it uses a simple enum for that.<br>

><br>
> But to give you an idea of what I'm doing inside DMD: I had to change the backend a little so it can emit special Objective-C-reserved segments with custom alignment, I had to change the parser to add a new keyword (__selector) and a syntax for specifying selectors and even to parse the "extern(Objective-C)" construct, I had to make strings literals implicitly convertible to Objective-C's NSString literals and made some other type implicitly convert to equivalents, I had to make 'static' functions virtual functions belonging to the Objective-C metaclass (whether I should have invented a new keyword for that is debatable), I had to create an implicit nested class named "Class" in each class representing the metaclass and to add the built-in property "this.class" to access the metaclass, I had to implement dynamic casts of Objective-C objects, and a few other ticks like that.<br>

></p>
<p>Aside from the parser changes, how much of that could be done with keyhole overrides (e.g. the name mangleing function and variable/member layout) and an extra set of augmentation passes (e.g. adding the nested Class and accessor)?</p>

<p>> The result of my work is starting to take shape. I'm currently a little stuck with memory management and finding a way to declare categories, but overall it's already starting to become usable. I made my first Cocoa test application last week.<br>

><br>
> --<br>
> Michel Fortin<br>
> <a href="mailto:michel.fortin@michelf.com">michel.fortin@michelf.com</a><br>
> <a href="http://michelf.com/">http://michelf.com/</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> dmd-internals mailing list<br>
> <a href="mailto:dmd-internals@puremagic.com">dmd-internals@puremagic.com</a><br>
> <a href="http://lists.puremagic.com/mailman/listinfo/dmd-internals">http://lists.puremagic.com/mailman/listinfo/dmd-internals</a><br>
</p>