🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Object Implementation in Script

Started by
12 comments, last by Rain Dog 18 years, 5 months ago
Is Object Implementation and Decleration a Planned feature? For my project it would be a necessary evil(good?), If so, I would like to offer a hand in completion of such, and if not. I would like to hear opinions about style, and implementation of such, as That is the major issue holding me back from using AngelScript Nicholas "Indy" Ray
Advertisement
Do you mean 1st class objects or POD types?

Angelscript already has POD types available, and shortly to be released there will be functions added to script declared structs.
Sorry, I did mean full class objects with inheretance and all the hassles that come with them.
I'm planning on implementing class methods and constructors for version 2.5.1. The version after that will hopefully include inheritance as well for script declared classes.

For now I will pretty much follow the C++ way of doing it. In a future version, or perhaps in a parallel project, I may implement other ways of supporting object oriented programming.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Do you think you would go the D way of inheritance? In that multiple inheritance is accomplished through mixins rather than straight multiple inheritance?
I need to read up on how the D language implements multiple inheritance. Or perhaps you could give me an overview of how it works in D?

Seeing as I have a much greater knowledge of C++ than any other language, it is likely that I'll go with the C++ way. But nothing has been decided yet.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I'm not strong on the D implementation, I've only skimmed the docs a few times, but the basic jist of it is that it implement single inheritance and I'm pretty positive virtual inheritance in a manner very similar to C++, except when it comes to multiple inheritance.

D provides what it calls mixins. A better explanation can be found here:

http://www.digitalmars.com/d/mixin.html
From what I understood the concept of 'mixin' in D is not related to class inheritance. 'mixin' seems to be more like macros than anything else.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

'Mixin' is an idiom used in C++ too. D's are little more than macros. Java offers interfaces instead of multiple inheritence. As usual, C++ favors power over safety. Multiple inheritence is error prone, but more powerful than either other implementation.
I think they are somewhat more powerful than macros however.

This topic is closed to new replies.

Advertisement