plum
git clone https://git.pyrossh.dev/plum
A statically typed, imperative programming language inspired by rust, python
58b01fc
— Peter John
2026-08-09T21:11:35+05:30
feat(libs/std): migrate remaining stdlib methods off <Receiver> syntax
- libs/std/float.plum +16 -15
- libs/std/int.plum +28 -29
- libs/std/json.plum +19 -19
- libs/std/list.plum +162 -162
- libs/std/map.plum +24 -24
- libs/std/result.plum +1 -1
- libs/std/str.plum +81 -81
libs/std/float.plum
CHANGED
|
@@ -16,24 +16,25 @@ EPSILON = 2.220446049250313e-16f # The difference between 1 and the smallest flo
|
|
|
16
16
|
MIN_FLOAT_VALUE = 4.9406564584124654417656879286822137236505980e-324 # Lowest value of float
|
|
17
17
|
MAX_FLOAT_VALUE = 1.79769313486231570814527423731704356798070e+308 # Highest value of float
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
type Float =
|
|
20
|
-
fun
|
|
20
|
+
fun acosh(self, v: Float) -> Float =
|
|
21
|
-
|
|
21
|
+
todo
|
|
22
22
|
|
|
23
|
+
# Check whether this number is finite, ie not +/-infinity and not NaN.
|
|
23
|
-
fun
|
|
24
|
+
fun isFinite(self) -> Bool =
|
|
24
|
-
|
|
25
|
+
todo
|
|
25
26
|
|
|
26
|
-
# Check whether this number is
|
|
27
|
+
# Check whether this number is +/-infinity
|
|
27
|
-
fun
|
|
28
|
+
fun isInfinite(self) -> Bool =
|
|
28
|
-
|
|
29
|
+
todo
|
|
29
30
|
|
|
30
|
-
# Check whether this number is
|
|
31
|
+
# Check whether this number is NaN.
|
|
31
|
-
fun
|
|
32
|
+
fun isNaN(self) -> Bool =
|
|
32
|
-
|
|
33
|
+
todo
|
|
33
34
|
|
|
34
|
-
# Check whether this number is NaN.
|
|
35
|
-
fun
|
|
35
|
+
fun toStr(self) -> Str =
|
|
36
|
-
|
|
36
|
+
todo
|
|
37
37
|
|
|
38
|
+
# parses a Float from a Str
|
|
38
|
-
fun
|
|
39
|
+
fun fromStr(s: Str) -> Result =
|
|
39
40
|
todo
|
libs/std/int.plum
CHANGED
|
@@ -4,46 +4,45 @@ MIN_VALUE = -0x8000_0000_0000_0000 # Lowest value of Int
|
|
|
4
4
|
MAX_VALUE = 0x7FFF_FFFF_FFFF_FFFF # Highest value of Int
|
|
5
5
|
LARGE = 1 << 28 # 2**28
|
|
6
6
|
|
|
7
|
-
type Int
|
|
7
|
+
type Int =
|
|
8
|
+
# returns the absolute value of the Int
|
|
9
|
+
fun abs(self) -> Int =
|
|
10
|
+
self < 0 ? -self : self
|
|
8
11
|
|
|
9
|
-
# returns a random Int
|
|
10
|
-
fun
|
|
12
|
+
fun ceil(self) -> Float =
|
|
11
|
-
|
|
13
|
+
todo
|
|
12
14
|
|
|
13
|
-
# parses an Int from a Str
|
|
14
|
-
fun
|
|
15
|
+
fun floor(self) -> Float =
|
|
15
|
-
|
|
16
|
+
todo
|
|
16
17
|
|
|
17
|
-
# returns the absolute value of the Int
|
|
18
|
-
fun
|
|
18
|
+
fun round(self) -> Float =
|
|
19
|
-
|
|
19
|
+
todo
|
|
20
20
|
|
|
21
|
-
fun
|
|
21
|
+
fun trunc(self) -> Float =
|
|
22
|
-
|
|
22
|
+
todo
|
|
23
23
|
|
|
24
|
-
fun
|
|
24
|
+
fun log(self) -> Float =
|
|
25
|
-
|
|
25
|
+
todo
|
|
26
26
|
|
|
27
|
-
fun
|
|
27
|
+
fun log2(self) -> Float =
|
|
28
|
-
|
|
28
|
+
todo
|
|
29
29
|
|
|
30
|
-
fun
|
|
30
|
+
fun log10(self) -> Float =
|
|
31
|
-
|
|
31
|
+
todo
|
|
32
32
|
|
|
33
|
-
fun
|
|
33
|
+
fun logb(self) -> Float =
|
|
34
|
-
|
|
34
|
+
todo
|
|
35
35
|
|
|
36
|
-
fun
|
|
36
|
+
fun pow(self, y: Float) -> Float =
|
|
37
|
-
|
|
37
|
+
todo
|
|
38
38
|
|
|
39
|
-
fun
|
|
39
|
+
fun sqrt(self) -> Float =
|
|
40
|
-
|
|
40
|
+
todo
|
|
41
|
-
|
|
42
|
-
fun logb<Int>(self) -> Float =
|
|
43
|
-
todo
|
|
44
41
|
|
|
42
|
+
# returns a random Int
|
|
45
|
-
fun
|
|
43
|
+
fun random() -> Float =
|
|
46
44
|
todo
|
|
47
45
|
|
|
46
|
+
# parses an Int from a Str
|
|
48
|
-
fun
|
|
47
|
+
fun fromStr() -> Result =
|
|
49
48
|
todo
|
libs/std/json.plum
CHANGED
|
@@ -31,34 +31,34 @@ type JsonParser =
|
|
|
31
31
|
next: Int
|
|
32
32
|
src: Readable
|
|
33
33
|
|
|
34
|
-
fun
|
|
34
|
+
fun parse(self) -> Result =
|
|
35
|
-
|
|
35
|
+
todo
|
|
36
36
|
|
|
37
|
-
fun
|
|
37
|
+
fun createErr(self) -> JsonParseError =
|
|
38
|
-
|
|
38
|
+
todo
|
|
39
39
|
|
|
40
|
-
fun
|
|
40
|
+
fun parseNone(self) -> Result =
|
|
41
|
-
|
|
41
|
+
todo
|
|
42
42
|
|
|
43
|
-
fun
|
|
43
|
+
fun parseBool(self) -> Result =
|
|
44
|
-
|
|
44
|
+
todo
|
|
45
45
|
|
|
46
|
-
fun
|
|
46
|
+
fun parseStr(self) -> Result =
|
|
47
|
-
|
|
47
|
+
todo
|
|
48
48
|
|
|
49
|
-
fun
|
|
49
|
+
fun parseFloat(self) -> Result =
|
|
50
|
-
|
|
50
|
+
todo
|
|
51
51
|
|
|
52
|
-
fun
|
|
52
|
+
fun parseInt(self) -> Result =
|
|
53
|
-
|
|
53
|
+
todo
|
|
54
54
|
|
|
55
|
-
fun
|
|
55
|
+
fun parseList(self) -> Result =
|
|
56
|
-
|
|
56
|
+
todo
|
|
57
57
|
|
|
58
|
-
fun
|
|
58
|
+
fun parseMap(self) -> Result =
|
|
59
|
-
|
|
59
|
+
todo
|
|
60
60
|
|
|
61
|
-
fun
|
|
61
|
+
fun withSrc(src: Readable) -> JsonParser =
|
|
62
62
|
todo
|
|
63
63
|
|
|
64
64
|
fun isSpace(c: Int) -> Bool =
|
libs/std/list.plum
CHANGED
|
@@ -15,169 +15,169 @@ type List[T: Stringable](Stringable) =
|
|
|
15
15
|
tail: Option[Node]
|
|
16
16
|
size: Int
|
|
17
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
|
-
self.
|
|
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
|
-
|
|
18
|
+
# gets the element at i'th index of the list
|
|
19
|
+
fun get(self, i: Int) -> Option[T] =
|
|
20
|
+
current = self.head
|
|
21
|
+
index = 0
|
|
22
|
+
while current != None
|
|
23
|
+
match current
|
|
24
|
+
Some(node) =>
|
|
25
|
+
if index == i
|
|
26
|
+
return Some(node.value)
|
|
27
|
+
current = node.next
|
|
28
|
+
index = index + 1
|
|
29
|
+
None =>
|
|
30
|
+
break
|
|
31
|
+
None
|
|
32
|
+
|
|
33
|
+
# sets the element at i'th index of the list
|
|
34
|
+
fun set(self, i: Int, v: T) -> Option[T] =
|
|
35
|
+
todo
|
|
36
|
+
|
|
37
|
+
# returns the no of elements in the list
|
|
38
|
+
fun length(self) -> Int =
|
|
39
|
+
self.size
|
|
40
|
+
|
|
41
|
+
# adds the specified elements to the start of the list
|
|
42
|
+
fun add(self, values: ...T) =
|
|
43
|
+
todo
|
|
44
|
+
|
|
45
|
+
# removes the element at i'th index of the list
|
|
46
|
+
fun removeAt(self, i: Int) =
|
|
47
|
+
todo
|
|
48
|
+
|
|
49
|
+
# removes the element v from list
|
|
50
|
+
fun remove(self, v: T) =
|
|
51
|
+
todo
|
|
52
|
+
|
|
53
|
+
# removes all objects from this list
|
|
54
|
+
fun clear(self) =
|
|
55
|
+
todo
|
|
56
|
+
|
|
57
|
+
# returns a new list with the elements in reverse order.
|
|
58
|
+
fun reverse(self, v: fn(T) -> Bool) -> List =
|
|
59
|
+
todo
|
|
60
|
+
|
|
61
|
+
# returns a new list with the elements sorted by sorter
|
|
62
|
+
fun sort(self, sorter: fn(T) -> Bool) -> List =
|
|
63
|
+
todo
|
|
64
|
+
|
|
65
|
+
# returns an item and index in the list if the item is is equal to search item
|
|
66
|
+
fun find(self, search: T) -> Option[T] =
|
|
67
|
+
todo
|
|
68
|
+
|
|
69
|
+
# returns the index of an item in the list if present and comparable otherwise None
|
|
70
|
+
fun contains(self, v: T) -> Bool =
|
|
71
|
+
todo
|
|
72
|
+
|
|
73
|
+
# calls f for each elem in the list
|
|
74
|
+
fun each(self, cb: fn(T)) -> Unit =
|
|
75
|
+
current = self.head
|
|
76
|
+
while current != None
|
|
77
|
+
match current
|
|
78
|
+
Some(node) =>
|
|
79
|
+
cb(node.value)
|
|
80
|
+
current = node.next
|
|
81
|
+
None =>
|
|
82
|
+
break
|
|
83
|
+
|
|
84
|
+
# returns a list made up of b elements for each elem in the list
|
|
85
|
+
fun map(self, cb: fn(T) -> U) -> List[U] =
|
|
86
|
+
nl = List()
|
|
87
|
+
current = self.head
|
|
88
|
+
while current != None
|
|
89
|
+
match current
|
|
90
|
+
Some(node) =>
|
|
91
|
+
item = cb(node.value)
|
|
92
|
+
nl.add(item)
|
|
93
|
+
current = node.next
|
|
94
|
+
None =>
|
|
95
|
+
break
|
|
96
|
+
nl
|
|
97
|
+
|
|
98
|
+
# returns a new list with each element flat-mapped
|
|
99
|
+
fun flatMap(self) =
|
|
100
|
+
todo
|
|
101
|
+
|
|
102
|
+
# returns a new list with the elements that matched the predicate
|
|
103
|
+
fun retain(self, predicate: fn(T) -> T) -> List =
|
|
104
|
+
todo
|
|
105
|
+
|
|
106
|
+
# returns a new list with the elements that matched the predicate removed
|
|
107
|
+
fun reject(self, predicate: fn(T) -> T) -> List =
|
|
108
|
+
todo
|
|
109
|
+
|
|
110
|
+
# returns true if any element in the list satisfies the predicate
|
|
111
|
+
fun any(self, predicate: fn(T) -> Bool) -> Bool =
|
|
112
|
+
todo
|
|
113
|
+
|
|
114
|
+
# returns true if all of the elements in the list satisfies the predicate
|
|
115
|
+
fun every(self, predicate: fn(T) -> Bool) -> Bool =
|
|
116
|
+
todo
|
|
117
|
+
|
|
118
|
+
# returns the accumulated value of all the elements in the list
|
|
119
|
+
fun reduce(self, acc: U, cb: fn(T) -> T) -> Option[U] =
|
|
120
|
+
todo
|
|
121
|
+
|
|
122
|
+
# returns the first element in the list
|
|
123
|
+
fun first(self) -> Option[T] =
|
|
124
|
+
match self.head
|
|
81
125
|
Some(node) =>
|
|
82
|
-
|
|
126
|
+
Some(node.value)
|
|
83
|
-
current = node.next
|
|
84
127
|
None =>
|
|
85
|
-
|
|
128
|
+
None
|
|
86
|
-
|
|
129
|
+
|
|
87
|
-
# returns
|
|
130
|
+
# returns the last element in the list
|
|
88
|
-
fun
|
|
131
|
+
fun last(self) -> Option[T] =
|
|
89
|
-
nl = List()
|
|
90
|
-
current = self.head
|
|
91
|
-
while current != None
|
|
92
|
-
match
|
|
132
|
+
match self.tail
|
|
93
133
|
Some(node) =>
|
|
94
|
-
|
|
134
|
+
Some(node.value)
|
|
95
|
-
nl.add(item)
|
|
96
|
-
current = node.next
|
|
97
135
|
None =>
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
fun take<List>(self, n: Int) -> List =
|
|
147
|
-
todo
|
|
148
|
-
|
|
149
|
-
# returns a list containing the first n elements of the given list
|
|
150
|
-
fun skip<List>(self, n: Int) -> List =
|
|
151
|
-
todo
|
|
152
|
-
|
|
153
|
-
# returns a list containing the first n elements of the given list
|
|
154
|
-
fun drop<List>(self, n: Int) -> List =
|
|
155
|
-
todo
|
|
156
|
-
|
|
157
|
-
# returns a new list with some of the elements taken randomly
|
|
158
|
-
fun sample<List>(self) =
|
|
159
|
-
todo
|
|
160
|
-
|
|
161
|
-
# returns a new list with all elements shuffled
|
|
162
|
-
fun shuffle<List>(self) =
|
|
163
|
-
todo
|
|
164
|
-
|
|
165
|
-
# returns a new list with all elements grouped by adjacent pairs
|
|
166
|
-
fun partition<List>(self) =
|
|
167
|
-
todo
|
|
168
|
-
|
|
169
|
-
# returns a new list with all elements grouped into chunks
|
|
170
|
-
fun chunk<List>(self) =
|
|
171
|
-
todo
|
|
172
|
-
|
|
173
|
-
# returns a new list with all elements grouped
|
|
174
|
-
fun groupBy<List>(self) =
|
|
175
|
-
todo
|
|
176
|
-
|
|
177
|
-
fun join<List>(self, sep: Str = ",") -> Str =
|
|
178
|
-
res = Buffer()
|
|
179
|
-
self.each(|v|
|
|
180
|
-
res.write(v.toStr())
|
|
181
|
-
res.write(sep)
|
|
182
|
-
)
|
|
183
|
-
res.toStr()
|
|
136
|
+
None
|
|
137
|
+
|
|
138
|
+
# returns a list containing the first n elements of the given list
|
|
139
|
+
fun sublist(self, start: Int, end: Int) -> List =
|
|
140
|
+
todo
|
|
141
|
+
|
|
142
|
+
# returns a list containing the first n elements of the given list
|
|
143
|
+
fun take(self, n: Int) -> List =
|
|
144
|
+
todo
|
|
145
|
+
|
|
146
|
+
# returns a list containing the first n elements of the given list
|
|
147
|
+
fun skip(self, n: Int) -> List =
|
|
148
|
+
todo
|
|
149
|
+
|
|
150
|
+
# returns a list containing the first n elements of the given list
|
|
151
|
+
fun drop(self, n: Int) -> List =
|
|
152
|
+
todo
|
|
153
|
+
|
|
154
|
+
# returns a new list with some of the elements taken randomly
|
|
155
|
+
fun sample(self) =
|
|
156
|
+
todo
|
|
157
|
+
|
|
158
|
+
# returns a new list with all elements shuffled
|
|
159
|
+
fun shuffle(self) =
|
|
160
|
+
todo
|
|
161
|
+
|
|
162
|
+
# returns a new list with all elements grouped by adjacent pairs
|
|
163
|
+
fun partition(self) =
|
|
164
|
+
todo
|
|
165
|
+
|
|
166
|
+
# returns a new list with all elements grouped into chunks
|
|
167
|
+
fun chunk(self) =
|
|
168
|
+
todo
|
|
169
|
+
|
|
170
|
+
# returns a new list with all elements grouped
|
|
171
|
+
fun groupBy(self) =
|
|
172
|
+
todo
|
|
173
|
+
|
|
174
|
+
fun join(self, sep: Str = ",") -> Str =
|
|
175
|
+
res = Buffer()
|
|
176
|
+
self.each(|v|
|
|
177
|
+
res.write(v.toStr())
|
|
178
|
+
res.write(sep)
|
|
179
|
+
)
|
|
180
|
+
res.toStr()
|
|
181
|
+
|
|
182
|
+
fun makeList(values: ...T) -> List =
|
|
183
|
+
List(None, None, 0).add(values)
|
libs/std/map.plum
CHANGED
|
@@ -10,27 +10,27 @@ type Pair[K, V] =
|
|
|
10
10
|
type Map[K, V] =
|
|
11
11
|
items: List[Pair[K, V]]
|
|
12
12
|
|
|
13
|
-
fun init
|
|
13
|
+
fun init(self, kvs: ...Pair) -> Map =
|
|
14
|
-
|
|
14
|
+
Map().add(kvs)
|
|
15
|
-
|
|
15
|
+
|
|
16
|
-
# adds the specified elements to the start of the list
|
|
16
|
+
# adds the specified elements to the start of the list
|
|
17
|
-
fun add
|
|
17
|
+
fun add(self, kvs: ...Pair) =
|
|
18
|
-
|
|
18
|
+
self.items.add(kvs)
|
|
19
|
-
|
|
19
|
+
|
|
20
|
-
# gets a value from the Map using key k
|
|
20
|
+
# gets a value from the Map using key k
|
|
21
|
-
fun get
|
|
21
|
+
fun get(self, k: K) -> Option[V] =
|
|
22
|
-
|
|
22
|
+
for p in self.items
|
|
23
|
-
|
|
23
|
+
if p.key == k
|
|
24
|
-
|
|
24
|
+
return Some(p.val)
|
|
25
|
-
|
|
25
|
+
None
|
|
26
|
-
|
|
26
|
+
|
|
27
|
-
# puts a value into the Map
|
|
27
|
+
# puts a value into the Map
|
|
28
|
-
fun set
|
|
28
|
+
fun set(self, k: K, v: V) =
|
|
29
|
-
|
|
29
|
+
self.items.add(Pair(key: k, val: v))
|
|
30
|
-
|
|
30
|
+
|
|
31
|
-
# puts a value into the Map if its not already present
|
|
31
|
+
# puts a value into the Map if its not already present
|
|
32
|
-
fun putIfAbsent
|
|
32
|
+
fun putIfAbsent(self, k: K, v: V) =
|
|
33
|
-
|
|
33
|
+
todo
|
|
34
|
-
|
|
34
|
+
|
|
35
|
-
fun map
|
|
35
|
+
fun map(self, cb: fn(Pair[K, V]) -> Pair[X, Y]) -> Map[X, Y] =
|
|
36
|
-
|
|
36
|
+
self.items.map(cb)
|
libs/std/result.plum
CHANGED
|
@@ -4,7 +4,7 @@ enum Result =
|
|
|
4
4
|
| Ok[T]
|
|
5
5
|
| Err[E]
|
|
6
6
|
|
|
7
|
-
fun isOk
|
|
7
|
+
fun isOk(self) -> Bool =
|
|
8
8
|
'checks whether the result is an Ok value'
|
|
9
9
|
match self
|
|
10
10
|
Ok(_) =>
|
libs/std/str.plum
CHANGED
|
@@ -10,123 +10,123 @@ trait Stringable =
|
|
|
10
10
|
type Str(Comparable, Stringable, Readable, Writable) =
|
|
11
11
|
data: Buffer
|
|
12
12
|
|
|
13
|
-
fun get
|
|
13
|
+
fun get(self, i: Int) -> Char =
|
|
14
|
-
|
|
14
|
+
todo
|
|
15
15
|
|
|
16
|
-
fun contains
|
|
16
|
+
fun contains(self, search: Str) -> Bool =
|
|
17
|
-
|
|
17
|
+
todo
|
|
18
18
|
|
|
19
|
-
fun indexOf
|
|
19
|
+
fun indexOf(self, sub: Str) -> Int =
|
|
20
|
-
|
|
20
|
+
todo
|
|
21
21
|
|
|
22
|
-
fun test
|
|
22
|
+
fun test(self, pattern: Regex) -> Bool =
|
|
23
|
-
|
|
23
|
+
todo
|
|
24
24
|
|
|
25
|
-
fun startsWith
|
|
25
|
+
fun startsWith(self, search: Str) -> Bool =
|
|
26
|
-
|
|
26
|
+
todo
|
|
27
27
|
|
|
28
|
-
fun concat
|
|
28
|
+
fun concat(self, other: Str) -> Str =
|
|
29
|
-
|
|
29
|
+
self + other
|
|
30
30
|
|
|
31
|
-
fun toStr
|
|
31
|
+
fun toStr(self) -> Str =
|
|
32
|
-
|
|
32
|
+
self
|
|
33
33
|
|
|
34
|
-
fun matchPattern
|
|
34
|
+
fun matchPattern(self, pattern: Regex) -> List =
|
|
35
|
-
|
|
35
|
+
todo
|
|
36
36
|
|
|
37
|
-
fun matchAll
|
|
37
|
+
fun matchAll(self, pattern: Regex) -> List =
|
|
38
|
-
|
|
38
|
+
todo
|
|
39
39
|
|
|
40
|
-
fun padStart
|
|
40
|
+
fun padStart(self, sub: Str, count: Int) -> Str =
|
|
41
|
-
|
|
41
|
+
todo
|
|
42
42
|
|
|
43
|
-
fun padEnd
|
|
43
|
+
fun padEnd(self, sub: Str, count: Int) -> Str =
|
|
44
|
-
|
|
44
|
+
todo
|
|
45
45
|
|
|
46
|
-
fun repeat
|
|
46
|
+
fun repeat(self, count: Int) -> Str =
|
|
47
|
-
|
|
47
|
+
todo
|
|
48
48
|
|
|
49
|
-
fun replace
|
|
49
|
+
fun replace(self, pattern: Regex, sub: Str) -> Str =
|
|
50
|
-
|
|
50
|
+
todo
|
|
51
51
|
|
|
52
|
-
fun replaceAll
|
|
52
|
+
fun replaceAll(self, pattern: Regex, sub: Str) -> Str =
|
|
53
|
-
|
|
53
|
+
todo
|
|
54
54
|
|
|
55
|
-
fun search
|
|
55
|
+
fun search(self, pattern: Regex) -> Str =
|
|
56
|
-
|
|
56
|
+
todo
|
|
57
57
|
|
|
58
|
-
fun slice
|
|
58
|
+
fun slice(self, start: Int, e: Int) -> Str =
|
|
59
|
-
|
|
59
|
+
todo
|
|
60
60
|
|
|
61
|
-
fun split
|
|
61
|
+
fun split(self, separator: Str, limit: Int) -> List =
|
|
62
|
-
|
|
62
|
+
todo
|
|
63
63
|
|
|
64
|
-
fun sub
|
|
64
|
+
fun sub(self, start: Int, e: Int) -> Str =
|
|
65
|
-
|
|
65
|
+
todo
|
|
66
66
|
|
|
67
|
-
fun toLower
|
|
67
|
+
fun toLower(self) -> Str =
|
|
68
|
-
|
|
68
|
+
todo
|
|
69
69
|
|
|
70
|
-
# reverses a Str
|
|
70
|
+
# reverses a Str
|
|
71
|
-
fun reverse
|
|
71
|
+
fun reverse(self) -> Str =
|
|
72
|
-
|
|
72
|
+
todo
|
|
73
73
|
|
|
74
|
-
fun camelCase
|
|
74
|
+
fun camelCase(self) -> Str =
|
|
75
|
-
|
|
75
|
+
todo
|
|
76
76
|
|
|
77
|
-
fun snakeCase
|
|
77
|
+
fun snakeCase(self) -> Str =
|
|
78
|
-
|
|
78
|
+
todo
|
|
79
79
|
|
|
80
|
-
fun capitalize
|
|
80
|
+
fun capitalize(self) -> Str =
|
|
81
|
-
|
|
81
|
+
todo
|
|
82
82
|
|
|
83
|
-
fun kebabCase
|
|
83
|
+
fun kebabCase(self) -> Str =
|
|
84
|
-
|
|
84
|
+
todo
|
|
85
85
|
|
|
86
|
-
fun lowerCase
|
|
86
|
+
fun lowerCase(self) -> Str =
|
|
87
|
-
|
|
87
|
+
todo
|
|
88
88
|
|
|
89
|
-
fun lowerFirst
|
|
89
|
+
fun lowerFirst(self) -> Str =
|
|
90
|
-
|
|
90
|
+
todo
|
|
91
91
|
|
|
92
|
-
fun upperCase
|
|
92
|
+
fun upperCase(self) -> Str =
|
|
93
|
-
|
|
93
|
+
todo
|
|
94
94
|
|
|
95
|
-
fun upperFirst
|
|
95
|
+
fun upperFirst(self) -> Str =
|
|
96
|
-
|
|
96
|
+
todo
|
|
97
97
|
|
|
98
|
-
fun startCase
|
|
98
|
+
fun startCase(self) -> Str =
|
|
99
|
-
|
|
99
|
+
todo
|
|
100
100
|
|
|
101
|
-
fun deburr
|
|
101
|
+
fun deburr(self) -> Str =
|
|
102
|
-
|
|
102
|
+
todo
|
|
103
103
|
|
|
104
|
-
fun escape
|
|
104
|
+
fun escape(self) -> Str =
|
|
105
|
-
|
|
105
|
+
todo
|
|
106
106
|
|
|
107
|
-
fun escapeRegExp
|
|
107
|
+
fun escapeRegExp(self) -> Str =
|
|
108
|
-
|
|
108
|
+
todo
|
|
109
109
|
|
|
110
|
-
fun pad
|
|
110
|
+
fun pad(self) -> Str =
|
|
111
|
-
|
|
111
|
+
todo
|
|
112
112
|
|
|
113
|
-
fun template
|
|
113
|
+
fun template(self) -> Str =
|
|
114
|
-
|
|
114
|
+
todo
|
|
115
115
|
|
|
116
|
-
fun trim
|
|
116
|
+
fun trim(self) -> Str =
|
|
117
|
-
|
|
117
|
+
todo
|
|
118
118
|
|
|
119
|
-
fun trimEnd
|
|
119
|
+
fun trimEnd(self) -> Str =
|
|
120
|
-
|
|
120
|
+
todo
|
|
121
121
|
|
|
122
|
-
fun trimStart
|
|
122
|
+
fun trimStart(self) -> Str =
|
|
123
|
-
|
|
123
|
+
todo
|
|
124
124
|
|
|
125
|
-
fun truncate
|
|
125
|
+
fun truncate(self) -> Str =
|
|
126
|
-
|
|
126
|
+
todo
|
|
127
127
|
|
|
128
|
-
fun unescape
|
|
128
|
+
fun unescape(self) -> Str =
|
|
129
|
-
|
|
129
|
+
todo
|
|
130
130
|
|
|
131
|
-
fun words
|
|
131
|
+
fun words(self) -> Str =
|
|
132
|
-
|
|
132
|
+
todo
|