Hi stef, I did some investigations and it seems to me that the problem comes from the ChangesBrowser. It stores the changes in a Set which in turn changes the order of declarations... So how can I define a method in a class that does not exit? The PickListModel is the culprit ;) Bellow you will find the snippet that I have promised... model := RBNamespace new . className := 'ANewClassForTheSystem' asSymbol. model defineClass: ('<1s> subclass: #<2s> instanceVariableNames: '''' classVariableNames: '''' poolDictionaries: '''' category: <3p>' expandMacrosWith: 'NBExternalStructure' with: className with: 'JustTesting'). model compile: 'myInstanceMethod ^''Hello world'' ' in: (model classNamed: className) classified: 'method declaration'. model compile: 'myClassMethod ^self new ' in: (model metaclassNamed: className) classified: 'method declaration'. "(ChangesBrowser changes: model changes ) openWithSpec ." (ChangesBrowser new change: model changes ) openWithSpec . Cheers On Mon, Dec 17, 2012 at 10:56 AM, Ciprian Teodorov < ciprian.teodorov@gmail.com> wrote:
@Igor that's an idea ... I think I'll go with that for the initial version
@stef I'll send a snippet this evening
Cheers On Dec 17, 2012 9:39 AM, "Stéphane Ducasse" <stephane.ducasse@inria.fr> wrote:
could you send a snippet that generate code?
Stef
On Dec 16, 2012, at 11:41 PM, Ciprian Teodorov wrote:
On Sun, Dec 16, 2012 at 11:02 PM, Stéphane Ducasse <
stephane.ducasse@inria.fr> wrote:
I'm writing a FFI generator for Pharo that uses libclang to parse header files and generates nativeboost mapping as output. The beast is almost working (I can get libclang mapping, the core.h header)but there are still some small issues. So, that's why I've been poking at nativeboost ;)
At the end I expect to have something that will generate correct ffi interface, and that will not bloat the image with thousand of visible classes, so that the user might get a chance to understand something of what I'm generating...
The thing is this evening after 4-5 hours of looking around my conclusion is. In pharo 1.4 the anonymous subclasses are breaking the tools, and in the brand new pharo 2.0 the refactoring tools (RBNamespace & company) are not working as they should.... so i'm stuck with 1.4 for now (and still telling to myself that I do not want to bloat the image with many classes)
Can you tell us what is the problem you got with RBNamespace? Because if we know we can try to fix it :).
When executing the refactorings that generate my code I get a DNU... (see attached .png) it seem that RBAddMethodChange does not implement the #includesSelector:
Stef
-- Dr. Ciprian TEODOROV Ingénieur Développement CAO
tél : 06 08 54 73 48 mail : ciprian.teodorov@gmail.com www.teodorov.ro <PharoScreenshot.png>
-- Dr. Ciprian TEODOROV Ingénieur Développement CAO tél : 06 08 54 73 48 mail : ciprian.teodorov@gmail.com www.teodorov.ro