Published
Jik v0.1.0-alpha.14
Jik v0.1.0-alpha.14 is now available.
Syntactic sugar for "must"
Use ! after a call that can throw when it must succeed, as an alternative to must.
x := div_safe(10, 2)! // equivalent to: x := must div_safe(10, 2)
print(x) // 5
Slices for vectors and strings
Vectors and strings now support the slicing operator:
numbers := [10, 20, 30, 40]
s1 := numbers[1:3] // [20, 30]
s2 := numbers[:2] // [10, 20]
word := "hello"
part := word[1:4] // "ell"
The slice creates a new object in the same region as the original one.
Release: Jik v0.1.0-alpha.14