-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patharraylike.go
More file actions
47 lines (32 loc) · 1.07 KB
/
arraylike.go
File metadata and controls
47 lines (32 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
43
44
45
46
47
// Copyright (c) 2025, Peter Ohler, All rights reserved.
package slip
// ArrayLike is an interface that all array and vectors implement.
type ArrayLike interface {
Object
// ArrayType returns the array type.
ArrayType() Symbol
// Dimensions of the array.
Dimensions() []int
// Length returns the length of the object.
Length() int
// AsList the Object into set of nested lists.
AsList() List
// Rank of the array is returned,
Rank() int
// Adjustable returns true if the array is adjustable.
Adjustable() bool
// ElementType returns the element-type of the array.
ElementType() Symbol
// SetElementType sets the element-type of the array.
SetElementType(ts Object)
// Get the value at the location identified by the indexes.
Get(indexes ...int) Object
// Set a value at the location identified by the indexes.
Set(value Object, indexes ...int)
// MajorIndex for the indexes provided.
MajorIndex(indexes ...int) int
// MajorGet for the index provided.
MajorGet(index int) Object
// MajorSet for the index provided.
MajorSet(index int, value Object)
}