feat: add MapEntry class and make Map a Sequence for direct iteration

Add MapEntry class to expose key-value pairs during map iteration, and make Map extend Sequence so maps can be directly iterated with `for` loops. Rename the internal `iterate_` primitive to `iterate` and update error messages for invalid map iterators.
This commit is contained in:
Bob Nystrom
2016-07-06 14:17:07 +00:00
parent a05f50ee24
commit 4d1215697e
13 changed files with 129 additions and 9 deletions
+4
View File
@@ -0,0 +1,4 @@
var entry = MapEntry.new("key", "value")
System.print(entry.key) // expect: key
System.print(entry.value) // expect: value