summaryrefslogtreecommitdiff
path: root/docs/language/operators.md
blob: 2b843ec37b121a3377a4c1052bea7a41373bca76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# General Operators

---

## Assign `:`

## Shadow `::`

## Cast `$`

```c
typedef kpl_result kpl_interface_cast(kpl_type to, const kpl_any from);
```

## ``log`

Configurable logger, destination can be changed

```c
typedef void kpl_interface_log(kpl_type type, const kpl_any any, const FILE *file, int32_t idnt, uint32_t options);
```

## ``debugger`

## ``thread_id`

```text
Thread_id `unique I32
```

## ``thread_count`

## ``format`

```text
Result[String] : Value[String]`format Any
```

### Formatting

#### Replace

Use `%` to indicate an item from `Any`, use `\%` for a literal `%`

#### Colors

Use `#NAME#` to change the text color, use `#` to reset the text color, use `\#` for a literal `#`

```text
BOLD
FAINT
ITALIC
UNDERLINE - UL

BACKGROUND - BG
LIGHT

BLACK
RED
GREEN
YELLOW
BLUE
MAGENTA
CYAN
GREY
WHITE
```

`#NAME#NAME#` use single `#` to apply multiple colors at once

```c
typedef kpl_result kpl_interface_format(const kpl_buffer *format, [const kpl_any]..., NULL);
```

## ``panic`

Stops execution and prints `Any` to `stdout`

```text
`panic any
```

## ``type`

## ``sync_type`

## ``async_type`

## ``copy`

```c
typedef kpl_result kpl_interface_copy(const kpl_any any);
```

## ``hash`

```c
typedef uint64_t kpl_interface_hash(const kpl_any any);
```