Skip to content

Similarity with list comprehensions #2

@danr

Description

@danr

I see this library as a way of expressing list comprehensions in javascript.
Your example can be written this way using list comprehensions (using syntax from python and haskell and ecmascript):

config = [ 
    {box, compiler, test, cmdline} 
    for box in [box1, box2, box3, box4],
    for compiler in [gcc, clang, msvc],
    for test in [frobnicate, loadtest, end2end],
    let cmdline = compiler.binary + ' ' + test.sources + ' -o ' + test.binary,
    !(test.binary == 'loadtest' && box.ram < 8)
]

Maybe it could be pedagogical to point this out in the readme.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions