Skip to main content
Branches, loops, your own functions and types, operators and arrays. Each row maps one concept from Lipi to the other languages; the word in a cell is the relation, explained in the language map overview. Each section below gives the Lipi construct first, then the construct in each language, with a note wherever behaviour differs. The language name links to the documentation the row was checked against.

Conditional block

Running a block only when a condition holds, with optional alternative branches. In Lipi: if, else. if has no value (x = if ... is a syntax error). Nonzero numbers are true, na is false; a string is rejected.

Choose by value

Running one of several blocks depending on the value of an expression. In Lipi: switch, case, default. No fall-through; one value per case. A switch inside a function body fails on Add to chart (Not Implemented): use if/else there.

Inline condition

An expression that gives one of two values depending on a condition. In Lipi this is written with the language’s own syntax. Only the chosen branch runs; an na condition takes the else branch. The branches need compatible types.

Counted loop

Repeating a block with a counter that runs from a start value to an end value. In Lipi: for to, step. The end is inclusive and a start above the end counts down, but equal bounds run zero times. by is not a keyword; use step.

Loop over a collection

Repeating a block once for each element of a collection. In Lipi: for in. Iterates only an array held in a variable: no expression after in, no index form. Assigning the loop variable does not change the array.

Conditional loop

Repeating a block while a condition holds. In Lipi: while. No iteration limit, but a history run is cancelled after 45 seconds.

Leave or skip a loop pass

Ending a loop early, or skipping to its next pass. In Lipi: break, continue.

Your own function

A named, reusable calculation declared by the script, with parameters and a result. In Lipi: func, return. Declare before use; no recursion; every parameter is typed. A function cannot rebind a global, and plot-family calls are not allowed inside one.

Method on a type

A function attached to a type and called on an object of that type. In Lipi: def. def needs at least one parameter, the receiver. Call it as value.name(...) or name(value, ...); a func cannot use dot syntax.

Arithmetic operators

Adding, subtracting, multiplying, dividing and taking remainders. In Lipi: +, -, *, /, %. / always returns float, even for two ints; division and modulo by zero give na. There is no ^: use math.pow.

Comparison operators

Testing whether values are equal, different, greater or smaller. In Lipi: ==, !=, >, <, >=, <=. Comparisons do not chain: write a < b and b < c. Test na with na(x); x == na compiles with a warning.

Logical operators

Combining or negating true/false values. In Lipi: and, or, not. No short-circuit: both operands are always evaluated. not binds tighter than comparison, so not 1 > 2 is a type error.

Update in place

Changing a variable by an amount in one step, such as adding to a running total. In Lipi this is written with the language’s own syntax. += also joins strings. /= on an int variable is rejected because / returns float.

Key-value collection

A collection that stores values under keys. Lipi has no construct for this. Lipi has no key-value collection type; use two arrays kept in step, or a user type.

Two-dimensional collection

A collection with rows and columns. Lipi has no construct for this. Lipi has no matrix type; use an array with computed indexes.

Reuse code from another file

Bringing in functions or types published in a separate file or library. Lipi has no construct for this. A Lipi script is one file; copy the functions you need into it.

Stop with an error

Ending the script on purpose with a message when a condition is not met. Lipi has no construct for this. Lipi has no function that raises a runtime error; guard the calculation and skip it instead.