Howto:Start using vectors and hashes in Nasal: Difference between revisions

Jump to navigation Jump to search
m
Line 187: Line 187:
Obviously, there's still one issue though: we are using lots of variables and helpers that all belong to the "waypoints" type, but which clutter our source code. So, next we are going to look into an even more flexible approach that nicely maps each waypoint field to a symbolic name, without having to remember vector indices.
Obviously, there's still one issue though: we are using lots of variables and helpers that all belong to the "waypoints" type, but which clutter our source code. So, next we are going to look into an even more flexible approach that nicely maps each waypoint field to a symbolic name, without having to remember vector indices.


== A hash based version ==
== A hash based version (recommended) ==


Now, to wrap these fields into a single variable that serves as the container for other variables, we could use a Nasal hash and start completely from scratch.  
Now, to wrap these fields into a single variable that serves as the container for other variables, we could use a Nasal hash and start completely from scratch.  

Navigation menu