Wafl Home

List Tutorial

List

List is the most often used structured data type in functional programming languages. Lists in Wafl may consist of elements of any type, but all elements of any specific list have to have a same type. The length of a list is not related to the list type.

List data type is written as List['1].

List literals are quoted by square brackets with elements separated by commas. Empty lists are written either by [] or nil.

Source code:

{#
[],
nil,
[1,2,3],
['a','b','c'],
[[1,2],[3,4,5],[6,7,8]]
#}

Result:

{# [], [], [1,2,3], ["a","b","c"], [[1,2],[3,4,5],[6,7,8]] #}

 

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.