Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 1022 Bytes

README.org

File metadata and controls

23 lines (18 loc) · 1022 Bytes

🍂 comps: Implementing Racket’s for comprehensions in Python 🐍

🌟 Overview

The goal of this project is to implement a Python version of Racket’s for comprehensions. The for_fold function simulates the behavior of Racket’s for/fold, including handling multiple accumulators, applying filters, and producing custom results. It’s all about bringing the expressive power of Racket into Python, while keeping things simple and elegant. ✨

This project leverages Python 3.11+ for the latest language features (like structural pattern matching) and uses cytoolz for its functional programming utilities. ⚡

🎯 Features

  • 🔄 Multiple accumulators over multiple iterables, just like in Racket!
  • 🔍 Optional filtering using a when clause to add logic to the loop.
  • 🎨 Flexible result expressions via a *result clause, so you can control the final output.
  • 📝 Typed for clarity, taking advantage of Python’s powerful typing system.

🛠️ Example Usage

🚧 Coming soon! 🚧