Giter VIP home page Giter VIP logo

exhaustive-rs's Introduction

exhaustive

exhaustive /ɪɡˈzɔːstɪv,ɛɡˈzɔːstɪv/ - including or considering all elements or aspects; fully comprehensive.

This crate was born from issue #23 in dtolnay/proc_macro_workshop.

I'd like to see a basic implementation of a macro for Python-style list and map comprehensions, and decide whether it would be a better teaching example for function-like proc macros than the current seq! project.

Something like:

let squares_map = c![n => n*n for n in 0..100 if n % 5 != 0];

Previous Work

There are some crates which implement this functionality or really similar, however, most of the crates are implemented using macro_rules!.

Captain Obvious: Which is not a procedural macro and thus not adequate as a learning example of such.

The existing crates are:

  • cute - Macro for Python-esque list comprehensions in Rust.
  • mapcomp - Python-like list comprehension via macros for some standard containers.
  • iter-comprehensions - A library for iterator comprehensions.
  • comprehension - Iterator comprehension in Rust.

The last one, comprehension, is the only one implemented using function-like procedural macros, however the syntax is based on Haskell, not Python.

exhaustive-rs's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.