diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-08-18 18:30:40 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-08-18 18:30:40 -0400 |
| commit | 46e0d88e88b5875881dff3f12de52d5dbe98cc78 (patch) | |
| tree | 3e2afedcf68e67392126ec623478dc88c36a639c /api/README.md | |
| parent | 43b4af23f84c27dada7a3515a7661f6311e4b3ba (diff) | |
Add README for API
Diffstat (limited to 'api/README.md')
| -rw-r--r-- | api/README.md | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/api/README.md b/api/README.md new file mode 100644 index 00000000..8c112c0b --- /dev/null +++ b/api/README.md @@ -0,0 +1,66 @@ +# API + +Tomo has a small number of built-in functions and bunch of types. + +## Types + +- [Arrays](arrays.md) +- [Booleans](booleans.md) +- [Channels](channels.md) +- [Integers](integers.md) +- [Floating point numbers](nums.md) +- [Integer Ranges](ranges.md) +- [Sets](sets.md) +- [Tables](tables.md) +- [Text](text.md) +- [Threads](threads.md) + +## Built-in Functions + +### `say` + +**Description:** +Prints a message to the console. + +**Usage:** +```markdown +say(text:Text) -> Void +``` + +**Parameters:** + +- `text`: The text to print. + +**Returns:** +Nothing. + +**Example:** +```markdown +say("Hello world!") +``` + +--- + +### `fail` + +**Description:** +Prints a message to the console, aborts the program, and prints a stack trace. + +**Usage:** +```markdown +fail(message:Text) -> Abort +``` + +**Parameters:** + +- `message`: The error message to print. + +**Returns:** +Nothing, aborts the program. + +**Example:** +```markdown +fail("Oh no!") +``` + +--- |
