enso/distribution/lib/Standard
Hubert Plociniczak fba5047acc
Improved Vector/Array interop (#3667)
`Vector` type is now a builtin type. This requires a bunch of additional builtin methods for its creation:
- Use `Vector.from_array` to convert any array-like structure into a `Vector` [by copy](f628b28f5f)
- Use (already existing) `Vector.from_polyglot_array` to convert any array-like structure into a `Vector` **without** copying
- Use (already existing) `Vector.fill 1 item` to create a singleton `Vector`

Additional, for pattern matching purposes, we had to implement a `VectorBranchNode`. Use following to match on `x` being an instance of `Vector` type:
```
import Standard.Base.Data.Vector

size = case x of
Vector.Vector -> x.length
_ -> 0
```

Finally, `VectorLiterals` pass that transforms `[1,2,3]` to (roughly)
```
a1 = 1
a2 = 2
a3 = 3
Vector (Array (a1,a2, a3))
```
had to be modified to generate
```
a1 = 1
a2 = 2
a3 = 3
Vector.from_array (Array (a1, a2, a3))
```
instead to accomodate to the API changes. As of 025acaa676 all the known CI checks passes. Let's start the review.

# Important Notes
Matching in `case` statement is currently done via `Vector_Data`. Use:
```
case x of
Vector.Vector_Data -> True
```
until a better alternative is found.
2022-09-13 03:07:17 +00:00
..
Base/0.0.0-dev Improved Vector/Array interop (#3667) 2022-09-13 03:07:17 +00:00
Database/0.0.0-dev Improved Vector/Array interop (#3667) 2022-09-13 03:07:17 +00:00
Examples/0.0.0-dev Get rid of free-floating atoms. Everything has a type now! (#3671) 2022-08-30 22:54:53 +00:00
Geo/0.0.0-dev Get rid of free-floating atoms. Everything has a type now! (#3671) 2022-08-30 22:54:53 +00:00
Google_Api/0.0.0-dev Explicit self (#3569) 2022-07-27 17:45:36 +00:00
Image/0.0.0-dev Improved Vector/Array interop (#3667) 2022-09-13 03:07:17 +00:00
Searcher/0.0.0-dev Adding DateTime part functions (#3669) 2022-08-26 15:47:58 +00:00
Table/0.0.0-dev Improved Vector/Array interop (#3667) 2022-09-13 03:07:17 +00:00
Test/0.0.0-dev Tidy up type signatures and error types (#3693) 2022-09-09 11:11:46 +00:00
Visualization/0.0.0-dev Improved Vector/Array interop (#3667) 2022-09-13 03:07:17 +00:00