Talk:Nasal scripting language: Difference between revisions
Jump to navigation
Jump to search
(→setprop() functionality: new section) |
m (→Usage: added) |
||
Line 8: | Line 8: | ||
== Mailing List Discussions == | == Mailing List Discussions == | ||
=== Usage === | === Usage === | ||
* [http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg01939.html Use of listeners to wait for events] | * [http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg01939.html Use of listeners to wait for events] | ||
* [http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg13557.html Nasal & "var"] | * [http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg13557.html Nasal & "var"] |
Revision as of 17:11, 13 October 2011
Contents that need to be incorporated
Todo
- mention/explain nil
- shorthand ops: += *= ~= /=
- operator precedence, prioritizing expressions using parentheses
- multi-assignments don't work as expected for functions with multiple return values
Mailing List Discussions
Usage
- Use of listeners to wait for events
- Nasal & "var"
- nasal variables
- Nasal, systime()
- Nasal, airportinfo()
- Nasal, removelistener
- logging nasal listener calls
- new features
- Nasal in scenery object XML files
- Nasal in scenery object XML files
- New Nasal Features (named function args, vector slicing, multi-assignments)
- Adding a nasal function in C/C++
- Nasal: new props.Node methods: alias()/unalias()
- nasal hash, populating via foreach
- new Nasal module: debug.nas
- logging to XML
Features
- nasal development news
- Nasal: new command "removelistener()"
- New Nasal in CVS
- nasal functionality?
- nasal iolib & security
Nasal Modules
Moving to Nasal Modules.
setprop() functionality
setprop() concatenates a list of input arguments by means of inserting a "/" in between. That is nice for properties, as this slash is part of the tree. However, when one wants to make use of indices, like [0], one has to concatenate by hand (using "~") inside one part of the string argument list. An example is:
var i = 4; setprop("instrumentation","cdu","page["~i~"]","title","MENU");
This results in instrumentation/cdu/page[4]/title = 'MENU' (string)
.
Hcc23