dev
Download
46 lines 867 BMarkdownModified 2025-10-18 raw

Builtins

CString

CString.as_text

CString.as_text : func(str: CString -> Text)

Convert a C string to Text.

Argument Type Description Default
str CString The C string. -

Return: The C string as a Text.

Example:

assert CString("Hello").as_text() == "Hello"

CString.join

CString.join : func(glue: CString, pieces: [CString] -> CString)

Join a list of C strings together with a separator.

Argument Type Description Default
glue CString The C joiner used to between elements. -
pieces [CString] A list of C strings to join. -

Return: A C string of the joined together bits.

Example:

assert CString(",").join([CString("a"), CString("b")]) == CString("a,b")

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
% API

# Builtins

# CString
## CString.as_text

```tomo
CString.as_text : func(str: CString -> Text)
```

Convert a C string to Text.

Argument | Type | Description | Default
---------|------|-------------|---------
str | `CString` | The C string.  | -

**Return:** The C string as a Text.


**Example:**
```tomo
assert CString("Hello").as_text() == "Hello"

```
## CString.join

```tomo
CString.join : func(glue: CString, pieces: [CString] -> CString)
```

Join a list of C strings together with a separator.

Argument | Type | Description | Default
---------|------|-------------|---------
glue | `CString` | The C joiner used to between elements.  | -
pieces | `[CString]` | A list of C strings to join.  | -

**Return:** A C string of the joined together bits.


**Example:**
```tomo
assert CString(",").join([CString("a"), CString("b")]) == CString("a,b")

```