Adds the ability for slice types ([] T) and dynamic array types ([..] T) to have "namespaces" called Slice and Array respectively that can be injected into. It also allows for methods on these types.
Now, the language is more consistent with how you interact with common data structures. Before, Map and Set could be used with methods (->get(...)) or with core.map/core.set, but arrays had to be used with the functions in core.array. Now, the following code is possible:
arr := make([..] u32)
for I in 10 do arr->push(i) // Would have been array.push(&arr, i)
arr->delete(0) // Would have been array.delete(&arr, 0)
println(arr) // 1 2 3 4 5 6 7 8 9
The old way is still possible. However, using the functions from core.array is not preferred, as they are not just aliases to functions in the builtin Array structure.
Adds the ability for slice types (
[] T
) and dynamic array types ([..] T
) to have "namespaces" calledSlice
andArray
respectively that can be injected into. It also allows for methods on these types.Now, the language is more consistent with how you interact with common data structures. Before,
Map
andSet
could be used with methods (->get(...)
) or withcore.map
/core.set
, but arrays had to be used with the functions incore.array
. Now, the following code is possible:The old way is still possible. However, using the functions from
core.array
is not preferred, as they are not just aliases to functions in the builtinArray
structure.