Closed JSAbrahams closed 2 years ago
Actually, slices and indexes should be different language constructs, since Python does treat these slightly differently.
This is especially complicated when we want functions to return either a Slice
or a Range
.
If they are the same language construct, then we will run into issues when we have a function returning either.
If Mamba has no way to differentiate the two, then both type checking and desugaring will be messy and produce applications with convoluted behavior.
Or, Mamba will say an application that appears well typed is not well typed, for instance.
Probably would've been best to do this in little bits and pieces over multiple PR's (and to start with tests first), but I guess we'll do it like this. I had originally not anticipated that it would be much effort since I did not consider the Slice
v Range
debacle.
:exclamation: No coverage uploaded for pull request base (
develop@73e3f19
). Click here to learn what that means. The diff coverage isn/a
.
@@ Coverage Diff @@
## develop #256 +/- ##
==========================================
Coverage ? 83.58%
==========================================
Files ? 99
Lines ? 9561
Branches ? 0
==========================================
Hits ? 7992
Misses ? 1569
Partials ? 0
:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more
Relevant issues
Closes #251 Closes #252
See #260 for discussion about functionality which could not fully be implemented in this PR.
Summary
Implement indexes for collections. An index may either be:
Int
Slice
Dictionaries ignored for now. If they are implemented, then an index may be something other than a slice or integer.
Added Tests