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 3. Variables

Another fundamental feature of programming languages is to provide a mechanism for storing values in memory to be used later. Here are some examples in Basic, Lisp and Water.

Basic:
x = 3
Lisp:
(setq x 3)
Water:
<set x=3 />

If I want to use the variable, I would access it like this:

Basic:
PRINT "x + 4 ="; x + 4
Lisp:
(format t "x + 4 = ~d" (+ x 4))
Water:
<concat "x + 4 = " x.<plus 4 /> />

Like the print statements in Example 2, doing simple calulations is relatively the same, but producing output is a bit different in each language.

Go back to go to the next example.

©Copyright 2004, Mr. Merrick J. Stemen. All rights reserved.