Andy Ross wrote:
Boris Koenig wrote:
2) And: Is it possible to load a Nasal file while the game is
running and execute it then ?
Not currently. Adding it would actually be non-trivial, because (as
in most similar languages) "loading" and "running" a script are the
same thing.
Being able to load a script from Nasal code is equivalent
to running a recursive Nasal interpreter context, something that the
current implemention doesn't support.
So, if I really wanted to execute a script, I would really have to
first nil'ing all existing nasal modules as well as the scripts
from the property lists, in order to re-load then all of it
INCLUDING the new file ?
I suppose we could wire up an fgCommand that did a script load, which
would work fine so long as you called it from a non-nasal context
(keyboard binding, etc...).
yes, actually I was not even (yet) thinking of loading one script from
another one, rather I would like to have a way to load a particular
script on demand, using a fgCommand linked to the menubar for that
purpose would definitely be already sufficient.
Fixing the interpreter to allow multiple contexts is definitely worth
doing. This would also allow for a non-callback API, where a script
could "sleep" for a bunch of frames and be woken up later on.
This sounds at lot like the solution to a problem that I just mentioned:
the event loop issue, so how are callbacks currently handled in Nasal ?
----------
Boris
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d