Skip to content

Commit 1f998b5

Browse files
committed
chore: update stdlib documentation
1 parent dd5ad46 commit 1f998b5

23 files changed

+641
-43
lines changed

content/docs/std/Async.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: "Async"
33
slug: "async"
44
description: ""
55
summary: ""
6-
date: 2026-02-01T01:09:07+02:00
7-
lastmod: 2026-02-01T01:09:07+02:00
6+
date: 2026-02-04T19:06:43+02:00
7+
lastmod: 2026-02-04T19:06:43+02:00
88
draft: false
99
weight: 410
1010
toc: true

content/docs/std/Benchmark.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: "Benchmark"
33
slug: "benchmark"
44
description: ""
55
summary: ""
6-
date: 2026-02-01T01:09:07+02:00
7-
lastmod: 2026-02-01T01:09:07+02:00
6+
date: 2026-02-04T19:06:43+02:00
7+
lastmod: 2026-02-04T19:06:43+02:00
88
draft: false
99
weight: 410
1010
toc: true

content/docs/std/Builtins.md

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
---
2+
title: "Builtins"
3+
slug: "builtins"
4+
description: ""
5+
summary: ""
6+
date: 2026-02-04T19:06:43+02:00
7+
lastmod: 2026-02-04T19:06:43+02:00
8+
draft: false
9+
weight: 410
10+
toc: true
11+
seo:
12+
title: "" # custom title (optional)
13+
description: "" # custom description (recommended)
14+
canonical: "" # custom canonical URL (optional)
15+
noindex: false # false (default) or true
16+
---
17+
18+
## toString
19+
20+
---
21+
`(toString value)`
22+
Convert a value to a string
23+
24+
25+
26+
#### Parameter
27+
- `value`: anything
28+
29+
30+
#### Example
31+
{{< highlight_arkscript >}}
32+
(print (toString "abc")) # "abc"
33+
(print (toString 1)) # "1"
34+
(print (toString (fun () ()))) # "Function@1"
35+
(print (toString print)) # "CProcedure"
36+
(print (toString [])) # "[]"
37+
(let x 1) (print (toString (fun (&x) ()))) # "(.x=1)"
38+
(print (toString (dict 1 2 3 4))) # "{1: 2, 3: 4}"
39+
(print (toString nil)) # "nil"
40+
(print (toString true)) # "true"
41+
(print (toString false)) # "false"
42+
{{< /highlight_arkscript >}}
43+
44+
## type
45+
46+
---
47+
`(type value)`
48+
Get the type of a given value as a string
49+
50+
51+
52+
#### Parameter
53+
- `value`: anything
54+
55+
56+
#### Example
57+
{{< highlight_arkscript >}}
58+
(print (type "abc")) # "String"
59+
(print (type 1)) # "Number"
60+
(print (type (fun () ()))) # "Function"
61+
(print (type print)) # "CProc"
62+
(print (type [])) # "List"
63+
(let x 1) (print (type (fun (&x) ()))) # "Closure"
64+
(print (type (dict 1 2 3 4))) # "Dict"
65+
(print (type nil)) # "Nil"
66+
(print (type true)) # "Bool"
67+
(print (type false)) # "Bool"
68+
{{< /highlight_arkscript >}}
69+
70+
## nil?
71+
72+
---
73+
`(nil? value)`
74+
Check if a value is nil
75+
76+
77+
78+
#### Parameter
79+
- `value`: anything
80+
81+
82+
#### Example
83+
{{< highlight_arkscript >}}
84+
(print (nil? "abc")) # false
85+
(print (nil? 1)) # false
86+
(print (nil? (fun () ()))) # false
87+
(print (nil? print)) # false
88+
(print (nil? [])) # false
89+
(print (nil? (dict 1 2 3 4))) # false
90+
(print (nil? nil)) # true
91+
(print (nil? true)) # false
92+
(print (nil? false)) # false
93+
{{< /highlight_arkscript >}}
94+
95+
## comparison
96+
97+
---
98+
`(comparison a b)`
99+
Compare two values and return true or false
100+
101+
**Note**: Comparing two values (using `<`, `>`, `<=`, `>=` and `=`) with a different type will always return false
102+
103+
104+
#### Parameters
105+
- `a`: first value
106+
- `b`: second value
107+
108+
109+
#### Example
110+
{{< highlight_arkscript >}}
111+
(print (< "abc" "def")) # true, string are compared lexicographically
112+
(print (< 2 1)) # false
113+
(print (> 3 -5.5) # true
114+
(print (> "Hello" ""))
115+
(print (<= [] [1 2])) # true, lists are compared lexicographically
116+
(print (<= [1 2] [1 0])) # false
117+
(print (<= [1 2] [10])) # true
118+
(print (>= 5 5)) # true
119+
(print (= false 5)) # false
120+
(print (!= false 5)) # true
121+
{{< /highlight_arkscript >}}
122+
123+
## not
124+
125+
---
126+
`(not value)`
127+
Convert a value to a boolean and invert it
128+
129+
130+
131+
#### Parameter
132+
- `value`: anything
133+
134+
135+
#### Example
136+
{{< highlight_arkscript >}}
137+
(print (not "")) # true
138+
(print (not "a")) # false
139+
(print (not 0)) # true
140+
(print (not 1)) # false
141+
(print (not [])) # true
142+
(print (not [1 2])) # false
143+
(print (not nil)) # true
144+
(print (not true)) # false
145+
(print (not false)) # true
146+
(print (not (dict))) # true
147+
(print (not (dict "a" 1))) # false
148+
{{< /highlight_arkscript >}}
149+
150+
## hasField
151+
152+
---
153+
`(hasField c field)`
154+
Check if a closure has a given field
155+
156+
157+
158+
#### Parameters
159+
- `c`: closure
160+
- `field`: string, field name to look for
161+
162+
163+
#### Example
164+
{{< highlight_arkscript >}}
165+
(let x 1)
166+
(let b "hello")
167+
(let closure (fun (&x &b) ()))
168+
(print (hasField closure "x")) # true
169+
(print (hasField closure "b")) # true
170+
(print (hasField closure "B")) # false, field names are case-sensitive
171+
{{< /highlight_arkscript >}}
172+
173+
174+
175+
{{< highlight_scripts >}}

content/docs/std/Bytecode.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: "Bytecode"
33
slug: "bytecode"
44
description: ""
55
summary: ""
6-
date: 2026-02-01T01:09:07+02:00
7-
lastmod: 2026-02-01T01:09:07+02:00
6+
date: 2026-02-04T19:06:43+02:00
7+
lastmod: 2026-02-04T19:06:43+02:00
88
draft: false
99
weight: 410
1010
toc: true

content/docs/std/Cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: "Cli"
33
slug: "cli"
44
description: ""
55
summary: ""
6-
date: 2026-02-01T01:09:07+02:00
7-
lastmod: 2026-02-01T01:09:07+02:00
6+
date: 2026-02-04T19:06:43+02:00
7+
lastmod: 2026-02-04T19:06:43+02:00
88
draft: false
99
weight: 410
1010
toc: true

content/docs/std/Dict.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: "Dict"
33
slug: "dict"
44
description: ""
55
summary: ""
6-
date: 2026-02-01T01:09:07+02:00
7-
lastmod: 2026-02-01T01:09:07+02:00
6+
date: 2026-02-04T19:06:43+02:00
7+
lastmod: 2026-02-04T19:06:43+02:00
88
draft: false
99
weight: 410
1010
toc: true
@@ -15,6 +15,42 @@ seo:
1515
noindex: false # false (default) or true
1616
---
1717

18+
## empty?
19+
20+
---
21+
`(empty? a)`
22+
Check if a dict is empty
23+
24+
25+
26+
#### Parameter
27+
- `a`: dict
28+
29+
30+
#### Example
31+
{{< highlight_arkscript >}}
32+
(print (empty? (dict "a" 2))) # false
33+
(print (empty? (dict))) # true
34+
{{< /highlight_arkscript >}}
35+
36+
## len
37+
38+
---
39+
`(len a)`
40+
Return the length of a dictionary
41+
42+
43+
44+
#### Parameter
45+
- `a`: dict
46+
47+
48+
#### Example
49+
{{< highlight_arkscript >}}
50+
(print (len (dict)) # 0
51+
(print (len (dict "a" 1 "b" 2 "c" 3))) # 3
52+
{{< /highlight_arkscript >}}
53+
1854
## dict
1955

2056
---

content/docs/std/Events.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: "Events"
33
slug: "events"
44
description: ""
55
summary: ""
6-
date: 2026-02-01T01:09:07+02:00
7-
lastmod: 2026-02-01T01:09:07+02:00
6+
date: 2026-02-04T19:06:43+02:00
7+
lastmod: 2026-02-04T19:06:43+02:00
88
draft: false
99
weight: 410
1010
toc: true

content/docs/std/Exceptions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: "Exceptions"
33
slug: "exceptions"
44
description: ""
55
summary: ""
6-
date: 2026-02-01T01:09:07+02:00
7-
lastmod: 2026-02-01T01:09:07+02:00
6+
date: 2026-02-04T19:06:43+02:00
7+
lastmod: 2026-02-04T19:06:43+02:00
88
draft: false
99
weight: 410
1010
toc: true

content/docs/std/Functional.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: "Functional"
33
slug: "functional"
44
description: ""
55
summary: ""
6-
date: 2026-02-01T01:09:07+02:00
7-
lastmod: 2026-02-01T01:09:07+02:00
6+
date: 2026-02-04T19:06:43+02:00
7+
lastmod: 2026-02-04T19:06:43+02:00
88
draft: false
99
weight: 410
1010
toc: true

content/docs/std/IO.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: "IO"
33
slug: "io"
44
description: ""
55
summary: ""
6-
date: 2026-02-01T01:09:07+02:00
7-
lastmod: 2026-02-01T01:09:07+02:00
6+
date: 2026-02-04T19:06:43+02:00
7+
lastmod: 2026-02-04T19:06:43+02:00
88
draft: false
99
weight: 410
1010
toc: true

0 commit comments

Comments
 (0)