Skip to content

Examples

Two programs that do real work. Both are live: change the inputs, edit the code, break it on purpose. Nothing here is a screenshot.

Symbols, a condition, and two outputs that share their working.

Things worth noticing:

  • >= in $score >= 60 is a symbol, and symbols are sugar. This one becomes Not(LessThan($score, 60)), which is why there is no GreaterThanOrEqual op to look up. See Operators and symbols.
  • adjusted is read twice, by topMark and by the finalScore output, and computed once. A binding is a name for a value, not a macro.
  • The diagnostics line stays quiet until you break something. Delete the 60 and it tells you where, before anything runs.

Lists, a lambda, and an input the lambda closes over.

  • Concat, Filter, Length and Average are ordinary ops. There is no list syntax and no loop; iteration is what these are for.
  • height => height >= $threshold is a lambda and a real closure: it captures $threshold from around it. Change the threshold and howManyTall moves while average does not, because average never reads it.
  • The three lists are separate inputs. One input holding a record with three fields would say the same thing, and will once a layer can declare its own struct types.

Both programs are in the repository, and both are checked by a test on every build, so they cannot drift from the language. Open either in the playground with the corner button, change whatever you like, and the URL becomes a link to exactly what you made. piece at a time.