-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change defines two helpers, Range and MapRange, that adapt the Iterable and IterableMapping interfaces to one- and two-variable range loops, and updates a variety of calls to use them. Pros: - more concise looping syntax. - no need to worry about Done. Cons: - possibly less efficient? Need to measure. - no "i int" index variable for free. Naming suggestions welcome. Obviously we can't submit this for a couple of years, though we could add the new API behind a go1.23 build tag.
- Loading branch information
Showing
5 changed files
with
108 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module go.starlark.net | ||
|
||
go 1.18 | ||
go 1.23 | ||
|
||
require ( | ||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.