-
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Inox slices are equivalent to Go slices. They are the primary way to create a sequence containing instances of a struct type.
Slices are not serializable.
struct Token {
kind int
start int
end int
}
# allocate and initialize a slice of length 3 on the module's heap
tokens = [:]Token{{0, 3, 4}}
# allocate a slice on the module's heap
tokens = new([:]Token, 10)
# append a token at the end of the slice, should it work like Golang's append ?
tokens = appendto(tokens, Token{0, 3, 4})
# equivalent
appendto(&tokens, Token{0, 3, 4})
Metadata
Metadata
Assignees
Labels
No labels