Features request

Started by
3 comments, last by Deyja 19 years, 4 months ago
Hi, here're some features request (I know, I still didn't tried implicit casting one and I come back with new requests :)) : 1) Aliases : it would be great to be able to declare aliases for classes, methods, members, etc. My use here (but it should also be used for other purposes) would be to preserve backward compatibility between releases (for example, I want to rename a class from cPoint to cCoord whilst preserving compatibily to cPoint class until script writers upgrades their scripts). I know I could declare both classes, but I would then require to declare all members/methods twice. This request is not a high priority yet (as it's possible to make it working using other ways). 2) Variable argument list (va_list like) : my goal here is not necessarily to declare script function with variable arguments (even if it could be great too), but at least to be able to get variable list in C++ code. For example, we could have a string.Printf( ... ) method in the c++ part which would allow to format texts easier in the script part (such as myString.Printf( "value= %d", myValue ). Best Regards, Lbas
Lbas
Advertisement
No worries, anyone can make feature requests [smile]

1) Some form of aliases or typedefs are planned for a future release. I can't say when though.

2) AngelScript will not support variable argument lists in script functions, as it is not safe. It would require a completely different way of passing arguments.

You can however register C functions that take variable argument lists, but you'll have to declare all the parameters that AngelScript should send.

Class methods with variable argument lists are not supported, as they use a different calling convention than asCALL_THISCALL.

Regards,
Andreas

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

1) Use my preprocessor. It's on the angelscript website. (Just be careful with including stuff. The inclusion guard is fatally flawed)

2) Register a collection class, like vector, and pass it instead.
1) that's a solution, but I wanted to write aliases from the application part, not in the scripts.

2) Ok, thanks for the tip. Anyway, it would very more user friendly (for the script writers) to be able to declare a variable parameters functions, I'll have a look at what it would imply.

Thx for the tips.
Lbas
Lbas
You can use the collection class in angelscript. Perhaps with a binding of boost::any and some simple list iteration you can emulate va_args. The multiple arguments system in C/C++ is essentially a hack anyway.

The any class may be foiled by having to register explicitly for every type the script uses.

This topic is closed to new replies.

Advertisement