Open hiiamboris opened 4 years ago
What happens if two vectors hold values of different datatypes, or of different sizes?
Good question. My first thought is to maintain consistency: (insert v1 v2) == insert (insert v1 first v2) next v2
. That is, follow the rules defined for vector elements. Which currently are not converting any types:
>> insert make vector! [0] 1.0
*** Script Error: invalid argument: 1.0
*** Where: insert
*** Stack:
>> insert make vector! [0.0] 1
*** Script Error: invalid argument: 1
*** Where: insert
*** Stack:
>> insert make vector! [0.0] 100%
*** Script Error: invalid argument: 100%
*** Where: insert
*** Stack:
The only thing that works right now I think is automatically promoting/demoting floats to 32/64 bits, which I propose should work for mass insertion too.
And integers between 8/16/32 bits (sorry, MS broke GH again, can't edit my own messages)
Describe the bug
Same goes for append ofc.
To reproduce
Expected behavior
Same as with blocks.
Platform version (please complete the following information)
Likely fix: extend the typecheck here https://github.com/red/red/blob/a4ee537c4b7dd40594db5e5809be8918deef38bd/runtime/datatypes/vector.reds#L1001