object orientation & scripting language integration,
Members - Reputation: 122
Posted 01 May 2002 - 02:05 PM
Moderators - Reputation: 1626
Posted 01 May 2002 - 06:16 PM
The Right Thing To Do is add additional support to FuBi to support virtual calls. A generalized functor (grep Loki) could help with that, as it turns every type of C++ invocation into a executable entity with first-class value semantics. It's hard to convey what that really means, if you don't grok the naunces of language 'citizenship'. The lack of first-class functions has long been a deficiency of C++, that interpretted OO & functional languages possessed (e.g. smalltalk & ML).
Alternatively, a virtual call is just a vtbl dereference and then a normal function call. It shouldn't be too hard to pack that into FuBi (I know, always easier said than done). You would need an additional FuBi table of virtual function names (use the mangled names) to virtual function offsets, which you would use on the vtbl of the passed object, then invoke the method in the vtbl by the normal Fubi means. Use the already in-place FuBi cookies to remote the object.
Almost undoubtly Scott has added this functionality to DS, though he may have run out of time. Odds are good a new article for Gems3 will cover this
P.S. The game Scott's been working on was released a few weeks ago, Dungeon Siege - cool game, I'm still learning how skrit'ing (DS scripting language) works (which is where he put FuBi to work).
[edited by - Magmai Kai Holmlor on May 2, 2002 1:20:04 AM]