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:
@@ -0,0 +1,4 @@
|
||||
var entry = MapEntry.new("key", "value")
|
||||
|
||||
System.print(entry.key) // expect: key
|
||||
System.print(entry.value) // expect: value
|
||||
Reference in New Issue
Block a user