A compiled and (almost) purely functional programming language with lazy evaluation, no mutable data types and a minimalist entirely indentation-sensitive syntax.

**Syntax**

**Syntax**

In Flow, the arguments of every command/function are listed vertically to the right of it, all at the same indentation level of the first one.

The only exception to this rule is the "txt" command (see the "textwall command" section below).

alpha beta epsilon zeta eta gamma theta iota kappa delta lambda mu nu

Example: program executing the function "alpha" on the arguments "beta" (which in turn operates on "epsilon", "zeta" and "eta"), "gamma" (which in turn operates on "theta", "iota" and "kappa") and "delta" (which in turn operates on "lambda", "mu" and "nu"").

Please be aware that none of the words used in this example are actual Flow keywords, they're only used as placeholders to illustrate how Flow syntax works.

**Types**

work in progress...
**Types**

**Commands**

**Commands**

Here are comprehensive lists of all commands in Flow, divided by their module.

**Default commands**

work in progress...
**Default commands**

**"output"**

**"output"**

output a

(a must be a string)

prints a;

**"intput"**

**"intput"**

intput a

(a must be a string)

waits until an user enters a, then adds the entered string (including a) as the last value of store;

**"input"**

**"input"**

input a

(a must be a string)

waits until an user enters a, then adds the entered string (not including a) as the last value of store;

**"do"**

**"do"**

do a b c ...

(a, b, c, etc... must be actions)

a, then b, then c, etc...;

**"if"**

**"if"**

if a b c d e f ...

(a, c, e, etc... must be statements; b, d, f, etc... can be anything)

if a is true, b; else, if c is true, d; else, if e is true, f; etc...;

**"case"**

**"case"**

case a b c d e f ...

(a, b, c, etc... must be statements; d, e, f, etc... can be anything)

if a is true, d; else, if b is true, e; else, if c is true, f; etc...;

**"try"**

**"try"**

try a b c ...

(a, b, c, etc... must be actions)

a; if a would result in an error, b instead; if b too would result in an error, c instead; etc...

**"let"**

**"let"**

let a b c d e f ... g

(a, c, e, etc... must be user-defined words; e, d, f, etc... can be anything; g must be a command)

executes g, where a is defined as b, c is defined as d, e is defined as f, etc...

**"el"**

**"el"**

el a b

(a and b must be sets)

list of the elements of a in b positions

**"par"**

**"par"**

par a b

(a and b must be sets)

parameter b of a

**"chn"**

**"chn"**

chn a

(a must be either a number or a numerical string)

numerical string representation of a, if a is a number; vice-versa otherwise

**"not"**

**"not"**

not a

(a must be a statement)

yes if a is no; no otherwise

**"both"**

**"both"**

both a b c ...

(a, b, c, etc... must be statements)

yes if a, b, c, etc... are all yes; no otherwise

**"eith"**

**"eith"**

eith a b c ...

(a, b, c, etc... must be statements)

yes if at least one among a, b, c, etc... is yes; no otherwise

**"ex"**

**"ex"**

ex a

(a can be anything)

yes if a exists; no otherwise

**"in"**

**"in"**

in a b

(a must be a set; b can be anything)

yes if b is an element of a; no otherwise

**"inc"**

**"inc"**

inc a b

(a and b must be sets)

yes if every element of b is also an element of a; no otherwise

**"eq"**

**"eq"**

eq a b c ...

(a, b, c, etc... can be anything)

yes if a, b, c, etc... are all the same value; no otherwise

**"inf"**

**"inf"**

inf a b c ...

(a, b, c, etc... must be numbers)

yes if a, b, c, etc... are placed in increasing order; no otherwise

**"sup"**

**"sup"**

sup a b c ...

(a, b, c, etc... must be numbers)

yes if a, b, c, etc... are placed in decreasing order; no otherwise

**"each"**

**"each"**

each a b c

(a must be a set; b is a new user-chosen word; c must be a statement)

yes if c(b) is true for all elements in a (where b is any element in a)

**"opp"**

**"opp"**

opp a

(a must be a number)

-a

**"inv"**

**"inv"**

inv a

(a must be a number)

1/a

**"sum"**

**"sum"**

sum a b c ...

(a, b, c, etc... must be numbers)

a+b+c+etc...

**"pro"**

**"pro"**

pro a b c ...

(a, b, c, etc... must be numbers)

a*b*c*etc...

**"dif"**

**"dif"**

dif a b c d ...

(a, b, c, d, etc... must be numbers)

a-b-c-d-etc...

**"fra"**

**"fra"**

fra a b c d ...

(a, b, c, d, etc... must be numbers)

a/b/c/d/etc...

**"min"**

**"min"**

min a

(a must be a set of numbers)

lowest element of a

**"max"**

**"max"**

max a

(a must be a set of numbers)

highest element of a

**"num"**

**"num"**

num a

(a must be a set)

number of elements in a

**"cap"**

**"cap"**

cap a

(a must be a character)

capital version of a

**"decap"**

**"decap"**

decap a

(a must be a character)

non-capital version of a

**"set"**

**"set"**

set a b c ...

(a, b, c, etc... can be anything)

set of the elements a, b, c, etc...

**"cyset"**

**"cyset"**

cyset a b c ...

(a, b, c, etc... can be anything)

set of infinite repetitions of a, b, c, etc...

**"des"**

**"des"**

set a b c d ...

(a must be a set; b, c, d, etc... can be anything)

set a without the elements b, c, d, etc...

**"allboth"**

**"allboth"**

allboth a b c ...

(a, b, c, etc... must be sets)

set of all elements who are simultaneously elements of a, b, c, etc...

**"alleith"**

**"alleith"**

alleith a b c ...

(a, b, c, etc... must be sets)

set of all elements who are elements of at least one among a, b, c, etc...

**"span"**

**"span"**

span a

(a must be a numbers)

set of all integers going from 1 to a

span a b

(a and b must be numbers)

set of all integers going from a to b

span a b c

(a, b and c must be numbers)

set of all numbers going from a to c, at intervals of b

**"such"**

**"such"**

such a b c

(a must be a set; b is a new user-chosen word; c must be a statement)

set of all elements in a such that c(b) is true (where b is any element in a)

**"for"**

**"for"**

for a b c

(a must be sets; b is a new user-chosen word; c can be anything)

set of all c(b) (where b is any element in a)

**"con"**

**"con"**

con a b c ...

(a, b, c, etc... must be sets)

set comprised of all the elements in a, b, c, etc...

**"sort"**

**"sort"**

sort a

(a must be a set)

set comprised of all the elements in a, sorted by alphabetical and/or numerical order

**"rev"**

**"rev"**

rev a

(a must be a set)

set comprised of all the elements in a, in inverted order

**"evar"**

**"evar"**

evar a b c d e f g ...

(a, b, c, d, e, f, g, etc... must be sets)

set a with the sequences of elements described by b, d, f, etc... replaced with those described by c, e, g, etc...

**"nvar"**

**"nvar"**

nvar a b c d e f g ...

(a, b, c, d, e, f, g, etc... must be sets)

set a with the elements in positions described by b, d, f, etc... replaced with those in positions described by c, e, g, etc...

**"that"**

**"that"**

that a

(a must be a string)

content of the file whose absolute path is described by a

**"this"**

**"this"**

this a

(a must be a string)

content of the file whose path relative to Flow's base directory is described by a

**"fun"**

**"fun"**

fun a b

(a must be a set; b can be anything)

function that operates b on the elements of a

**"rec"**

**"rec"**

rec a

(a must be a function)

function that applies a recursively to its argument and to all elements in it

**Unpackaging command**

**Unpackaging command**

unp a

(a must be a set)

all the elements of a (as if they weren't elements of a set)

**Unwinding command**

**Unwinding command**

unw a

(a must be a string)

code block described by a

**Textwall command**

**Textwall command**

txt abc...

(abc... must be a text block)

string that, when printed, reports abc... exactly as it's written

**Comments**

**Comments**

| abc...

(abc... must be a text line)

ignored

**"Math" module commands**

work in progress...
**"Math" module commands**

do unp for natural n if each des span n 1 n i not in natural fra n i output chn n

do unp for natural n if eq 2 num such span n i in natural fra n i output chn n

Examples: different ways of writing a program that lists prime numbers