Warning
WORK IN PROGRESS
Implementation of some useful data structures in Zig. Inspired by Python's itertools
module.
Implemented so far:
ChainIterator
- "glues" two iterator in one, returns their elements in successionSliceIterator
- iterates over a sliceEmptyIterator
- emits no elements. Implemented only for testing purposes.
-
In the root directory of your project, run the following command to add
zig_itertools
to yourbuild.zig.zon
file (replace 0.0.1 with the latest release number):zig fetch --save https://github.com/insolor/zig-itertools/archive/refs/tags/0.0.1.zip
Replace
main
in the URL with the tag you want to use. -
Add zig_itertools as a dependency module in your
build.zig
file, example:const zig_itertools = b.dependency("zig_itertools", .{}); exe.root_module.addImport("zig_itertools", zig_itertools.module("zig_itertools"));
After that, you'll be able to import zig_itertools
namespace from your code:
const zig_itertools = @import("zig_itertools");
const ChainIterator = zig_itertools.ChainIterator;