Added Vectors and Matrics operations, slicing, docs.
This commit is contained in:
1 parent
a72991d1b7
commit
83d8c8b71f
31 files changed
+1972
-41
No files matched your search
+18
-2
@@ -1183,8 +1183,24 @@ collection's sugar won't work with it:
|
||||
assertEquals("buzz", x[0])
|
||||
>>> void
|
||||
|
||||
If you want dynamic to function like an array, create a [feature
|
||||
request](https://gitea.sergeych.net/SergeychWorks/lyng/issues).
|
||||
Multiple selectors are packed into one list index object:
|
||||
|
||||
val x = dynamic {
|
||||
get {
|
||||
if( it == [1, 2] ) "hit"
|
||||
else null
|
||||
}
|
||||
}
|
||||
assertEquals("hit", x[1, 2])
|
||||
>>> void
|
||||
|
||||
So:
|
||||
|
||||
- `x[i]` passes `i`
|
||||
- `x[i, j]` passes `[i, j]`
|
||||
- `x[i, j, k]` passes `[i, j, k]`
|
||||
|
||||
This is the same rule used by Kotlin-backed `getAt` / `putAt` indexers in embedding.
|
||||
|
||||
# Theory
|
||||
|
||||
|
||||
Reference in new issue
Block a user