On 10/31/2009 12:18 AM, Roland Plüss wrote:
Something I didn't understand on the way you manipulate ST data from C?
You forgot the instance variables defined by superclasses of "DEEngine
class". Better initialize uniqueInstance lazily:
DEEngine class [
| uniqueInstance |
uniqueInstance [ ^uniqueInstance ifNil: [self new] ]
new [ <cCall: 'DEEngine.new' returning: #smalltalk args: #() ]
]
...
// in the creation function
OOP oopClass = gst_class_name_to_oop( "DEEngine" );
deEngine::m_stUniqueInstance = pST->CreateNewObject( oopClass );
gst_register_oop (deEngine::m_stUniqueInstance);
...
static OOP deEngine::stNew ()
{
return deEngine::m_stUniqueInstance;
}
...
gst_define_cfunc ("DEEngine.new", deEngine::stNew);
Nice to see some code in this thread!
Paolo
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk