Skip to content

A python package that implements Racket's comprehensions

License

Notifications You must be signed in to change notification settings

dr-neptune/comps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍂 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! 🚧

About

A python package that implements Racket's comprehensions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages