It's now possible to put Nasal files into $FG_HOME/Nasal/, that
is: ~/.fgfs/Nasal/ on Unix, and %APPDATA%\flightgear.org\Nasal\
on MS Windows. This has the advantage that:

- one doesn't have to mix local extensions with standard files
- one is less likely to lose such local additions when upgrading
- one doesn't need write permission to $FG_ROOT/Nasal/ or
- one doesn't have to become "root" to edit such files

The files are guaranteed to be read after all the files in
$FG_ROOT/Nasal/, so one can safely use elements of files like
props.nas (props.Node), or globals.nas (setlistener() without
leading underscore).

The files are guaranteed to be read in alphabetic order. So, if
there are two files where one depends on the other, just name
them appropriately.

The contents of each file are added to a namespace derived from
the filename. So, all functions and variables of a file
~/.fgfs/nasal/local.nas will be added to nasal namespace "local",
and a function test() is globally accessible as local.test().

It's possible to extend a standard module like "math" with
definitions in ~/.fgfs/Nasal/math.nas, though this should, of
course, not be exploited by code that is to be submitted to cvs.

m.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to