Wafl Home

Primitive Data Types Tutorial

Primitive Data Types

Primitive types are Integer, Float, String and Bool.

Integer and float literal constants have the similar syntax as in programming language C. Float literals must contain decimal point and at least one digit before it.

Logical literal constants are true and false.

String literals are quoted by single or double quotes. Special characters are specified by escape sequences, like in programming language C. Most important escape sequences are: single quote (\'), double quote (\"), backslash (\\), new line (\n), carriage return (\r), horizontal tab (\t), vertical tab (\v), form feed (\f) and backspace (\b).

Source code:

{#
0, 42, -21,
3.4, 0., 1.2e-3,
true || false,
'abc' + "def"
#}

Result:

{# 0, 42, -21, 3.400000, 0.000000, 0.001200, true, "abcdef" #}

 

Table of Contents

Let's Start

Program Structure

Primitive Data Types

List

Tuple

Record

HTML

Command Line Interpreter

Using Web Servers

Syntax

Examples

Tips

The most of examples evaluates with both command line and Web server Wafl interpreters. If any example is based on specific features of an interpreter, it is explicitly annotated.