Skip to content

WIP. Implementation of some useful iterators in Zig. Inspired by Python's itertools module.

Notifications You must be signed in to change notification settings

insolor/zig-itertools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zig Itertools

Zig 0.14.0, 0.14.1, master zig build test

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 succession
  • SliceIterator - iterates over a slice
  • EmptyIterator - emits no elements. Implemented only for testing purposes.

Installation

  1. In the root directory of your project, run the following command to add zig_itertools to your build.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.

  2. 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;

About

WIP. Implementation of some useful iterators in Zig. Inspired by Python's itertools module.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published