Jump to content

  • Log In with Google      Sign In   
  • Create Account


- - - - -

Features request


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Lbas   Members   -  Reputation: 122

Like
0Likes
Like

Posted 30 November 2004 - 10:21 PM

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

Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3242

Like
0Likes
Like

Posted 01 December 2004 - 12:47 AM

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

#3 Deyja   Members   -  Reputation: 920

Like
0Likes
Like

Posted 07 December 2004 - 11:53 AM

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.

#4 Lbas   Members   -  Reputation: 122

Like
0Likes
Like

Posted 08 December 2004 - 09:36 PM

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

#5 Deyja   Members   -  Reputation: 920

Like
0Likes
Like

Posted 11 December 2004 - 02:09 PM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS