• Advertisement
Sign in to follow this  

Ignoring selected script calls on compile

This topic is 4927 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What about a feature which allows you to selectively ignore certain calls totally when compiling a script? This would allow construction of an assert-function, for example. So that it could be decided on runtime if the script is being compiled as a "debug" build (with asserts) or as a "release" build without any extra code like this. In API this could be as simple as allowing registration of NULL as method or function pointer. Inside script build code any calls to functions or objects would be just ignored if their handler is NULL. Then application could register NULL handlers instead of the true handlers when it wants to leave the additional debugging code out which is written into the scripts. Alternatively the API could have an option to flag certain functions or methods to be conditional for usage, and on a call to script build it would be told if the conditional stuff should be ignored or compiled normally. Disclaimer: I haven't tried if it would already work this way, although I doubt that would be the case. :-)

Share this post


Link to post
Share on other sites
Advertisement
You could probably preproccess the script yourself, stripping out all calls yourself. I'm guessing it's probably faster to use an empty function, though.

Share this post


Link to post
Share on other sites
This is actually a pretty good idea.

It would only work on functions that doesn't return anything though, i.e. void.

I'll write down the suggestion in my to-do list so I don't forget it. Thanks jetro.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement