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.
Pointers in AngelScript: Really necessary?
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement