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 6. A Quick Server Example

One of the great features of Water is its attitude of being a web services language. Basic and Lisp were not historically developed with this in mind, and so web service features have been added as an afterthought to each. Microsoft's Visual Basic has web service controls available, but it is not as easy to construct as in Water. I will only show the Water code here.

Water:
<server <plus 3 2 /> />

The server above serves the same data every time, the sum of 3 and 2.

Water:
<server "Hello, World!" />

The server above serves the same data every time, the string "Hello, World!".

Water:
<defmethod add2nums first=0 second=0>
<plus first second />
</defmethod>

<server add2nums />

The server above responds to submissions from a browser like:
http://localhost/?first=20&second=40
The result will return the sum of the two numbers--60.

There are other elements needed to help flesh out more full-featured servers, but this is good for many things to get a programmer started experimenting with web services.

Go back to go to the next example.

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