Wafl Home

Record Tutorial

Record Update Selectors

Record update selector is an operator that evaluates the updated record. Because WAFL core is pure functional, the record that is first operand of update selector is not changed or updated.

The basic form of record update selector is:

<record>^<element-name>(<value>);

A basic update selector ^name(...) is applicable to any record having an element with a specified name. Its type is (Record[name:'1]['2] * '1 -> Record[name:'1]['2]).

In an advanced form, a sequence of update selectors can be used. In that case, the syntax: R^a^b^c(x) is semantically equivalent to: R^a( R.a^b( R.a.b^c(x) ) ).

Please note that expressions R^a^b(x) and R.a^b(x) are not semantically equivalent. The first evaluates the record R where value of R.a.b is replaced with x. The second evaluates R.a where value of attribute b is replaced with x.

 

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.