Introduction to Water Programming |
This Site is intended to provide helps to Water language programmers around the world through technical examples, informational articles, and personal assistance.
The following examples are meant to be a quick Getting Started sort of tutorial using the Steam Free Version or the IDE. (If you are using the Free Version, be sure to set the output to "Rendered HTML".)
Example 5. Assigning Other Variable Types - Arrays/Vectors/ListsAnother fundamental feature of programming languages is to provide a mechanism for storing values in memory other than numbers. Here are some examples in Basic, Lisp and Water.
Basic:If I want to use the nth element of each list, I would access it like this:
Basic:Notice that Water and Lisp return the variable's value like Example 1. Whereas, Basic needs a PRINT statement to display the value.
If I want to list the contents of each list, I could use this:
Basic:Notice the use of the <concat /> method to stick a line-break after each element printed.
Go back to go to the next example.