General Lexical Issues

SFL is a free-form language. That means that, in most contexts, a newline or tab is like a space, and several spaces in a row are equivalant to a single space.

SFL is case-sensitive. So R and r are considered different letters.

A comment begins with // and ends at the end of the line.


Values

The values of SFL have the following forms.

true, false

Values true and false are simple values used as the results of tests.

Integers

Integers (..., −2, −1, 0, 1, 2, ...) are values. Integers are 32 bit 2's complement integers. So they are restricted to the range from −231 to 231−1. Adding 1 to 231 − 1 yields −231.

Characters

Characters constants have the form 'a'. There are two special character constants, '\n' and '\\', standing for the newline character and the backslash character.

[x, y, z]

A value can be a list of zero or more things. We will write lists in square brackets, with commas separating the list members.

For example, [1, 2, 3] is a list of three things. [3] is a list with just one integer in it. [true, false] is a list of two boolean values. [ ] is the empty list. SFL is a typeless language, so you can create list [true, 3].

Functions

Functions are values. Each function takes exactly one parameter, and produces exactly one result.

Actions

An action is a command. It runs and produces a result.

I said above that there are no commands. To be precise, there are no commands that you can run from within the program. An action is just a data structure. You can build up actions, but only an external agent can perform them.

Actions include forms

There is more on actions in other sections.