Language Tour

Keikaku is built on simplicity and explicitness.

Variables

KEIKAKU Protocol
1# Implicit declaration (preferred)
2name := "Keikaku"
3version := 1.0
4
5# Explicit declaration
6designate count = 42
7
8# Lists
9items := [1, 2, 3]

Functions (Protocols)

Functions are called protocols in Keikaku. They can accept arguments and yield values.

KEIKAKU Protocol
1protocol greet(name):
2 # String interpolation is automatic
3 declare("Hello,", name)
4 yield "done"
5
6result := greet("User")

Built-in Functions

  • declare(...)

    Print to output.

  • inquire(prompt)

    Read user input.

  • measure(x)

    Get length of list/string.

  • span(n)

    Create range [0..n-1].