Jump to content

  • Log In with Google      Sign In   
  • Create Account


- - - - -

Multiple Definiton in Angelscript


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
2 replies to this topic

#1 bollµ   Members   -  Reputation: 354

Like
0Likes
Like

Posted 18 February 2013 - 10:44 PM

Hi all!

 

I'm finding it more and more annoying that on binding the same function twice to angelscript, it just dosen't give you a sensible warning. Angelscript doesn't warn you when you register then function the 2nd time, but rather tells you that there are "multiple matching signatures" to the function. I just spent a whole day looking for an alternate signature, after which I realized I was binding the function twice.

 

is there some sort of flag that we can send to AS_Engine that notifies us on registering a function twice? (Sure, there will be some overhead in checking this, maybe O(n) if we do a linear search, or O(1) if we decide to hash the string. That's why we could have a flag that lets us control this). Or is there some other way to figure out if a function (or a class) is being bound twice? (BTW, binding a class twice gives some weird errors. Angrlscript starts complaining about the destructor of the class that the behavior I'm trying to register is invalid. It also doesn't let you instantiate the class properly. I guess this maybe the accepted behavior? )

 

but it would be really nice to have some sort of a feature like this. Heck, I'd be happy to implement it if you told me where to modify the code.

 

/rant

 

Thanks.

~Bollu.

 

PS- English isn't my first language, so do correct me if I've made some sort of mistake :)


a WIP 2d game engine: https://code.google.com/p/modulusengine/

English is not my first language, so do feel free to correct me :)


Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3293

Like
0Likes
Like

Posted 19 February 2013 - 08:08 AM

Hmm. The engine is supposed to check against registering duplicate functions, methods, and types. The registration function should return an error (you do check the return codes, don't you?), and if you ignore that error and try to compile a script anyway you'll get an "Invalid configuration" error.

 

Can you give examples? Perhaps there is some bug that makes the code not see the duplicates.


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 bollµ   Members   -  Reputation: 354

Like
0Likes
Like

Posted 19 February 2013 - 09:24 PM

I am checking most of them, but this one might have slipped past. lemme go and check my code :)


a WIP 2d game engine: https://code.google.com/p/modulusengine/

English is not my first language, so do feel free to correct me :)





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