Qu

algorigram

Builtin index · Plotting

result = algorigram(name, [file=])

Input: name, file · Output: result

What it is

Renders a flowchart of the named function's control flow: if/else as a decision diamond with yes/no branches that rejoin, while/for/do...loop as a decision with a routed "repeat" back-edge, select case and try/catch as their own multi-way/two-way branches. name (string) must resolve to exactly one overload (§ multiple dispatch) — an overloaded function raises a clear error asking for a single-overload name instead.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = algorigram(name, [file=])
name stringname (string) must resolve to exactly one overload (§ multiple dispatch) — an overloaded function raises a clear error asking for a single-overload name instead.
file optionalnot documented yet
result string
Returns the SVG (string).

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

function classify(x)
  if x > 0
    y = 1
  else
    y = -1
  end if
  return y
end function
svg = algorigram("classify")
data = 0 to 99
print(diagram_pipeline(() := data |> lowpass(fc=1000) |> fft() |> abs()))
output
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 830.00 124.00" width="830.00" height="124.00" font-family="Inter, Helvetica, Arial, sans-serif">
<rect x="0" y="0" width="830.00" height="124.00" fill="#ffffff"/>
<line x1="191.00" y1="62.00" x2="233.60" y2="62.00" stroke="#333333" stroke-width="1.4"/>
<polygon points="239.00,62.00 230.00,65.60 230.00,58.40" fill="#333333" stroke="none" stroke-width="1.00" opacity="1"/>
<line x1="391.00" y1="62.00" x2="433.60" y2="62.00" stroke="#333333" stroke-width="1.4"/>
<polygon points="439.00,62.00 430.00,65.60 430.00,58.40" fill="#333333" stroke="none" stroke-width="1.00" opacity="1"/>
<line x1="591.00" y1="62.00" x2="633.60" y2="62.00" stroke="#333333" stroke-width="1.4"/>
<polygon points="639.00,62.00 630.00,65.60 630.00,58.40" fill="#333333" stroke="none" stroke-width="1.00" opacity="1"/>
<rect x="40.00" y="40.00" width="150.00" height="44.00" rx="22" fill="#e6f4ea" stroke="#333333" opacity="1"/>
<text x="115.00" y="66.55" font-size="13" text-anchor="middle" fill="#333333">data</text>
<rect x="240.00" y="40.00" width="150.00" height="44.00" rx="6" fill="#eef3fb" stroke="#333333" opacity="1"/>
<text x="315.00" y="66.55" font-size="13" text-anchor="middle" fill="#333333">lowpass(fc=1000)</text>
<rect x="440.00" y="40.00" width="150.00" height="44.00" rx="6" fill="#eef3fb" stroke="#333333" opacity="1"/>
<text x="515.00" y="66.55" font-size="13" text-anchor="middle" fill="#333333">fft()</text>
    ... 3 more lines

from plotting

How it works

algorigram(name, [file=]) (2026-09-18) — a flowchart of a user function's control flow (if/else, while/for, select case, try/catch), walked from its own AST. See just argument handling -- the by-name lookup below reuses the same self.methods overload table every other by-name builtin (fzero, map, ...) reads through text_arg, so algorigram accepts a function's name the same way they do.

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.