Skip to content

Commit cebbcce

Browse files
committed
chore(docs): add @require in docs
1 parent fa79682 commit cebbcce

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎List.ark‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
# (list:slice1 [1 2 3 4 5] 1 3) # [2 3 4]
5151
# =end
5252
# @author https://github.com/SuperFola
53+
# @require 4.6.0 Requires ArkScript 4.6.0 or later
5354
(let slice1 (fun (_L _start _end) (builtin__slice _L _start _end 1)))
5455

5556
# @brief Sort a List and return a new one
@@ -76,6 +77,7 @@
7677
# (list:zeros 4) # [0 0 0 0]
7778
# =end
7879
# @author https://github.com/SuperFola
80+
# @require 4.6.0 Requires ArkScript 4.6.0 or later
7981
(let zeros (fun (_count) (builtin__list:fill _count 0)))
8082

8183
# @brief Generate a List of n ones
@@ -84,6 +86,7 @@
8486
# (list:ones 4) # [1 1 1 1]
8587
# =end
8688
# @author https://github.com/SuperFola
89+
# @require 4.6.0 Requires ArkScript 4.6.0 or later
8790
(let ones (fun (_count) (builtin__list:fill _count 1)))
8891

8992
# @brief Modify a given list and return a new one
@@ -177,6 +180,7 @@
177180
# (let p (list:cumulativeProduct collection)) # => [1 2 6 24]
178181
# =end
179182
# @author https://github.com/SuperFola
183+
# @require 4.6.0 Requires ArkScript 4.6.0 or later
180184
(let cumulativeProduct (fun ((ref _L)) {
181185
(mut _index 0)
182186
(mut _output [])
@@ -213,6 +217,7 @@
213217
# (let p (list:cumulativeSum collection)) # => [1 3 8 20]
214218
# =end
215219
# @author https://github.com/SuperFola
220+
# @require 4.6.0 Requires ArkScript 4.6.0 or later
216221
(let cumulativeSum (fun ((ref _L)) {
217222
(mut _index 0)
218223
(mut _output [])
@@ -450,6 +455,7 @@
450455
# (print (list:first [1 2 3 4 5 6 7 8 9] 4)) # [1 2 3 4]
451456
# =end
452457
# @author https://github.com/SuperFola
458+
# @require 4.6.0 Requires ArkScript 4.6.0 or later
453459
(let first (fun ((ref _L) _n)
454460
(if (<= (len _L) _n)
455461
_L
@@ -463,6 +469,7 @@
463469
# (print (list:last [1 2 3 4 5 6 7 8 9] 4)) # [6 7 8 9]
464470
# =end
465471
# @author https://github.com/SuperFola
472+
# @require 4.6.0 Requires ArkScript 4.6.0 or later
466473
(let last (fun ((ref _L) _n)
467474
(if (<= (len _L) _n)
468475
_L

‎String.ark‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
# (print (string:join (list:map (string:codepoints "🏳️‍⚧️") string:chr) "")) # 🏳️‍⚧️
8686
# =end
8787
# @author https://github.com/SuperFola
88+
# @require 4.6.0 Requires ArkScript 4.6.0 or later
8889
(let codepoints (fun (_str) (builtin__string:codepoints _str)))
8990

9091
# @brief Get the ordinal of a given character
@@ -119,6 +120,7 @@
119120
# @brief Check if a string is only ASCII
120121
# @param _str String where the lookup occurs
121122
# @author https://github.com/SuperFola
123+
# @require 4.6.0 Requires ArkScript 4.6.0 or later
122124
(let ascii? (fun (_str) (= (len _str) (builtin__string:utf8len _str))))
123125

124126
# @brief Check if a string contains a word
@@ -465,6 +467,7 @@
465467
# (print (string:first "hello world" 4)) # "hell"
466468
# =end
467469
# @author https://github.com/SuperFola
470+
# @require 4.6.0 Requires ArkScript 4.6.0 or later
468471
(let first (fun ((ref _L) _n)
469472
(if (<= (len _L) _n)
470473
_L
@@ -477,6 +480,7 @@
477480
# (print (string:last "hello world" 4)) # "orld"
478481
# =end
479482
# @author https://github.com/SuperFola
483+
# @require 4.6.0 Requires ArkScript 4.6.0 or later
480484
(let last (fun ((ref _L) _n)
481485
(if (<= (len _L) _n)
482486
_L
@@ -512,6 +516,7 @@
512516
# (print (string:lpad "42" 4 "a")) # aa42
513517
# =end
514518
# @author https://github.com/SuperFola
519+
# @require 4.6.0 Requires ArkScript 4.6.0 or later
515520
(let lpad (fun (_str _n _c) {
516521
(assert (= 1 (len _c)) "string:lpad expected a single character to pad")
517522
(if (>= (len _str) _n)
@@ -526,6 +531,7 @@
526531
# (print (string:rpad "42" 4 "a")) # 42aa
527532
# =end
528533
# @author https://github.com/SuperFola
534+
# @require 4.6.0 Requires ArkScript 4.6.0 or later
529535
(let rpad (fun (_str _n _c) {
530536
(assert (= 1 (len _c)) "string:rpad expected a single character to pad")
531537
(if (>= (len _str) _n)

0 commit comments

Comments
 (0)