OK, more stuff at: http://www.plausible.org/andy/fg-nasal-1.4.tar.gz
Core Nasal changes: New "ghost" facility for wrapping C pointers in a GC-friendly way. Lexer fixes from Melchior to properly handle \x escaping. Lexer fixes to correctly handle "_" in symbol names. Bug with the string concatenation operator where temporaries could be garbage-collected in mid-execution. Crashing bug when code was called in the same context after a parse error. Nasal scripts: There are now props.nas and globals.nas files to put in $FGROOT/Nasal. Unlike the previous modules, these two are required. The globals.nas adds some Nasal-defined functions to the global namespace, and props.nas defines the Node superclass for the property implementation (see below). New FGNasalSys features: A parseAndRun() function that executes arbitrary source code passed as a const char*, because Curt asked for it. :) A rather nice SGPropertyNode wrapper named "props.Node". You can now traverse the property tree intelligently, using almost exactly the same interface as in C++. The global tree is available as props.global, you can create new nodes using props.Node.new(), etc... There is also a recursive props.dump() implementation for debugging and informative purposes. This is the first time I've been able to walk through the whole tree while running the simulator; lots of fun. The old string-based getprop() and setprop() functions are still there; they work well for lots of situations. Not all of the features of SGPropertyNode are supported. There is no support for ties, obviously, as that wouldn't make much sense from a scripting context. The various get/set methods work only on the local node, there is no equivalent of the "relative path" variants available in C++; just use node.getNode(path).whatever() instead. There is no support for the "listener" interface yet. The aliasing feature isn't exposed, except that you can get an "ALIAS" return from getType to detect them (to avoid cycles while walking trees). The fgcommand() function has been updated to take a Node object as the command argument. You can still pass a string (path into the global tree) if you like. The old, hard-coded "offset" and "value" variables passed to command bindings has been eliminated. Instead, you now have access to an actual Node object via the built-in cmdarg() function. Why a function instead of an automatic arg? It was simpler to implement this way; the return value of cmdarg() is a props.Node object. Nasal objects are much simpler to initialize in Nasal than in C++. _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
