DreamBerd icon indicating copy to clipboard operation
DreamBerd copied to clipboard

Interpolation at indexing

Open donRumata03 opened this issue 1 year ago • 0 comments

There's a code example where values are associated with non-integer indexes:

const var scores = [3, 2, 5]!
scores[0.5] = 4
print(scores) //[3, 2, 4, 5]!

That's cool but there's a crucial ergonomic issue: what if the value at index 0.5 has never been assigned but a user wants to get a reasonable result for the indexing operation?

In this case, we obviously need to do some AI interpolation (or an arithmetic mean as a temporary solution)

donRumata03 avatar Jun 16 '23 19:06 donRumata03