forked from erlang/otp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compiler: Add zip generators for comprehensions
We introduce zip generators for comprehensions to reduce the need for users to use lists:zip. Zip generators have the syntax of generator1 && ... && generatorN, where each generator can be a list, binary, or map generator. Zip generators are evaluated as if they are zipped to be a list of tuples. They can be mixed with all existing generators and filters freely. Two examples to show how zip generators is used and evaluated: 1> [{X,Y} || X <- [a,b,c] && Y <- [1,2,3]]. [{a,1},{b,2},{c,3}] 2> << <<(X+Y)/integer>> || X <- [1,2,3] && <<Y>> <= <<1,1,1>>, X < 3 >>. <<2,3>>
- Loading branch information
Showing
28 changed files
with
2,276 additions
and
40 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
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.