Skip to main content
gamedev.net
🔒 Locked

Squirrel - Function in Function?

Started by blanky Oct 28, 2005 at 9:00 PM 2 replies 1k views
Original Post
blanky
blanky
Hey guys, this might seem like a dumb question but after giving it thought, I got confused. Say I make a function, but inside that function I call another function, if I register it with sqplus, will I be able to use that function even if the function inside that function isn't registered with it? Say I wasn't using squirrel, hell even lua, would it work? Just made me think, thanks.
John Schultz
John Schultz
If a C/C++ function is registered with a scripting language, said C/C++ function can call any other C/C++ function before returning (they don't have to be registered). However, if during the C/C++ call a function call is made back into the scripting language (calling a function defined in script), that could pose a problem (depends on the scripting language design and how states are managed). If such behavior is not documented, try it out by tracing through the code with the debugger.
fagiano
fagiano
In Squirrel you can nest as many script to C++ and C++ to script call as you wish...(as far as you have enough stack space :) in your system). Same for LUA.

ciao
Alberto
-----------------------------The programming language Squirrelhttp://www.squirrel-lang.org
blanky
blanky
Thanks fagiano and John Schultz!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.