Skip to content

Racket-inspired iteration and sequence forms for Elisp

License

Notifications You must be signed in to change notification settings

usaoc/elisp-for

Repository files navigation

For

https://melpa.org/packages/for-badge.svg https://stable.melpa.org/packages/for-badge.svg

For is an Emacs Lisp extension package that provides iteration and sequence forms inspired by Racket. For detailed documentation, refer to the manual.

Introduction

Racket, extending on the idea of SRFI 42, provides iteration and sequence forms that are both efficient and generic. The iteration forms essentially expand to calls to self-tail-recursive procedures, similar to ~do~ and named let forms. The sequence constructors serve a twofold purpose, acting both as transformers and normal procedures. This package aims to implement a subset of the functionalities of Racket’s iteration and sequence forms. For those looking for iteration forms closer to the Common Lisp Loop Facility, also available in Emacs Lisp, Loopy is a better option that provides iteration forms in the same vein as Iterate.

How to Use

This package can be installed through the user’s package manager of choice, such as the built-in package manager or Straight. A =Makefile= is provided for those who manually install the package, where targets are available for compiling the Emacs Lisp files, building the documentation, as well as running the test suites.

If only the iteration forms and sequence expanders are used, it is recommended that the named feature for be available only at compile time, otherwise the named feature must also be available at execution time. Shorthands may be useful for those who use the sequence generators.

Although it is not a must, it is recommended that lexical binding be enabled, as this package is designed and optimized for such usage.

This package requires minimally Emacs 28.1.

Contribute

Submit an issue for bug reports and general discussion. Submit a pull request for patches. Otherwise, send an email with patches attached if any.