comptools 0.1.0

Create iterators using Python's list comprehesion style.
Documentation
  • Coverage
  • 100%
    5 out of 5 items documented5 out of 5 items with examples
  • Size
  • Source code size: 14.44 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.24 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • jeertmans/comptools
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • jeertmans

CompTools

CI Build Status Latest Release Python version Documentation

Create iterators using Python's list comprehesion style.

Macros for Python-like list comprehension creation of iterators.

Another Crate that tries to bring the simplicty of Python's syntax to Rust iterators.

The main macro is iter, and other macros are extensions of the latter.

Examples

Below, small examples of how the macros work:

use comptools::*;

let vec: Vec<u64> = vect![x*x; for x in 0..=10; if x % 2 == 0];
assert_eq!(vec, vec![0, 4, 16, 36, 64, 100]);

let sum: u64 = sum![x*x; for x in 1..; while x*x*x < 1234];
assert_eq!(sum, 385);

Contributing

Contributions are more than welcome!