GitXplorerGitXplorer
a

ZipNsequence

public
9 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
4c1a18c46741e410aec7a1f9180e56a4dc51624b

Added reference to pre-generated sources

aamomchilov committed 8 years ago
Unverified
db59168a75d94b1b7e4e3dd7f77ad1ea61631f5f

Added precomputed source files for arity 3...10

aamomchilov committed 8 years ago
Unverified
cf57caf3462eb23178a186cafcaafb1748b3fbeb

Added usage instructions

aamomchilov committed 8 years ago
Unverified
9ceb9b3f68c07363cc6322218ba11cffcda943e0

Initial commit

committed 8 years ago
Unverified
74e49126d891748d22b364689f42291ff33342f5

Initial commit

aamomchilov committed 8 years ago

README

The README file for this repository.

ZipNsequence

A GYD template for producing ZipSequences of arbitrary arity.

Usage:

  1. Import one of the pre-generated ZipSequence swift source files.
  2. Use them just like you would expect:
let a = [1, 2, 3]
let b = [4, 5, 6]
let c = [7, 8, 9]
for (x, y, z) in zip(a, b, c) {
       print("\(x) \(y) \(z)")
}

Generating Custom Arity ZipSequences

If the pre-generaged ZipSequences don't suite your needs, generate your own:

  1. Obtain a copy of the Generate Your Boilerplate preprocessor (gyb.py) from the Swift repository.
  2. Run is with the following syntax:

python gyb.py --line-directive '' -D arityS=3 ZipNSequence.swift.gyb -o Zip3Sequence.swift

  • The input gyb tempalte is ZipNSequence.swift.gyb
  • The arity is 3 (in this example)
  • The output file is Zip3Sequence.swift