🎉 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!

"Using"

Started by
4 comments, last by Miss 5 years, 8 months ago

Am I correct in thinking that Angelscript does not currently support the 'using' keyword? If so, that is a bit of a shame: it would allow us to stick the whole library in a namespace, without actually having to bother the user with having to prefix everything with 'std::'. Right now this isn't a big deal for us yet, since there is only one version of our tool and the user can easily avoid name clashes in their scripts, but I'm thinking about future updates that will have additional library classes and functions. Ideally those would live in their own namespace, so as not to cause any name clashes, but I'd still like the ability to bring them into a script using either a single `using namespace <name>`, or, should that result in a clash, a more targeted `using <object name>`. So uhh, could I request for this to be added to the Angelscript wish list? ?

While I'm at it, I certainly wouldn't say no to the ability to catch exceptions in scripts either ?

Advertisement

You're correct. 'using' is not currently supported. It is on the to-do list, though not very high on my priority list. 

Catching exceptions in the script has recently been implemented and is available in the WIP version.

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

Additionally, it would be nice to have this with the ability to alias namespaces (like in C++).

On 9/28/2018 at 12:39 PM, WitchLord said:

You're correct. 'using' is not currently supported. It is on the to-do list, though not very high on my priority list. 

Catching exceptions in the script has recently been implemented and is available in the WIP version.

Ah, I didn't realize there was already a version supporting exceptions. Is the WIP version suitable for use in a production environment? Or would it be better to wait for a formal release?

We've had several issues with the development version in the past, but considering there's no real (regular) release schedule, it's probably best to try and see if it's suitable enough for you. Personally, I am using the WIP version for one of my hobby projects because it has a few crucial fixes that I needed, but we're using the latest release at work (from 2017) for our released game on Steam.

This topic is closed to new replies.

Advertisement