Pointers in AngelScript: Really necessary?

Started by
32 comments, last by WitchLord 19 years, 5 months ago
Mortal:

AngelScript 2 will work with object basically the same way as Java does. There will be a slight performance hit because of this, but it should be negligable in the context of a scripting language. The language syntax will be simpler though, and much more consistent. And of course it will be easier for me to develop further features.

Wuntvor:

AngelScript 2's object variables will basically be smart pointers. The . operator will access the objects methods directly. I'm not sure if the -> will be implemented, probably not.

I may implement the possibility to overload -> for AngelScript 1.x.x though. That should allow you to implement smart pointers.

desertcube:

I agree.

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

Advertisement
I'm using handle classes exstensivly. Though I don't technically need an operator->, it would simplify a lot of things in my scripts. The handles manage pointers. They are essentially reference counted smart pointers that make calls directly into the engine to manage game resources. Right now, I pass them to global functions. It is, unfortunatly, quite possible to pass a texture to a function that expects a sound. With operator->, I could register the texture class, and all the functions that use it as methods, and continue using my handles - except with type safety! (Assuming, of course, polymorphism works in some future release.)
I would also like the -> operator to remain, but only as an overloaded operator. I don't really need it, but it provides a nicer syntax.
Your wishes has been granted: The overloadable -> operator is on the todo list for AngelScript 1.x.x. [smile]

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

This topic is closed to new replies.

Advertisement