mattgathu / cute Goto Github PK
View Code? Open in Web Editor NEWMacro for Python-esque comprehensions in Rust
Home Page: https://mattgathu.github.io/cute
License: MIT License
Macro for Python-esque comprehensions in Rust
Home Page: https://mattgathu.github.io/cute
License: MIT License
Third level nested loops are not in the current crates.io
version, do you think you can publish them?
Consider supporting an arbitrary number of for
expressions rather than requiring the macro to be extended for each one? This would likely resolve #4, and lead to a fix for #6, and maybe support any number of if
expressions as well? A "0-or-more" style of logic would work well, and fit nicely into a recursive macro.
Implement Generator Comprehensions
Support for lazy evaluation.
The equivalent of Python's {x for x in iter}.
It would be nice to be able to write a conditional at any location in the expression, e.g. c![a + b, for a in some_vec, if a % 5 < 2, for b in 0..10]
. This could work well with generators (#1) to reduce nested computations, though I'm not sure how well that would end up vectorizing if at all.
The arity c!
is called with determines the iteration order - c![(a, b, c), for a in 0..5, for b in 0..5, for c in 0..5]
is iterated differently than c![(a, b), for a in 0..5, for b in 0..5]
.
Documentation tests are not passing at the moment. Documentation need to be rewritten for doc tests to pass.
For example, you can't write c![(b, a), for &(a, b) in &[(0, 1), (2, 3)]
- the macro asks for a ident
rather than pat
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.