Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler: Add zip generators for comprehensions #8926

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Oct 15, 2024

  1. 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>>
    lucioleKi committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    9f0e080 View commit details
    Browse the repository at this point in the history