Open phated opened 4 years ago
I'll tackle this one!
We're not quite ready for this one since we don't yet have pattern matching on arrays. My bad for mislabeling this one!
@ospencer I believe you said that we still can't implement recursion with array pattern matches because we don't support ...rest
-style pattern matches, is that correct? Should I create another issue for this to be blocked upon?
That's correct. In that issue, we should probably discuss if we want to support ...rest
for Arrays since it requires us to copy array[1:]
on each iteration (not that we couldn't, but it would be really inefficient).
That's correct. In that issue, we should probably discuss if we want to support
...rest
for Arrays since it requires us to copyarray[1:]
on each iteration (not that we couldn't, but it would be really inefficient).
Perhaps that could be supported by adding a layer of indirection in front of arrays? Then, when doing a slice, we just return a new view of the same underlying array? (cross-posting to #490)
When we can pattern match on arrays, we need to rewrite
Array.contains
with recursion instead of a while-loop.Ref #188