Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/NicolasPetton/stream
Lazy sequence library for Emacs.
https://github.com/NicolasPetton/stream
Last synced: 2 months ago
JSON representation
Lazy sequence library for Emacs.
- Host: GitHub
- URL: https://github.com/NicolasPetton/stream
- Owner: NicolasPetton
- License: gpl-3.0
- Created: 2015-10-14T11:15:11.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-01T22:04:02.000Z (over 8 years ago)
- Last Synced: 2024-10-16T06:34:53.718Z (3 months ago)
- Language: Emacs Lisp
- Size: 30.3 KB
- Stars: 31
- Watchers: 5
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# stream.el [![Build Status](https://secure.travis-ci.org/NicolasPetton/stream.png)](http://travis-ci.org/NicolasPetton/stream)
## Summary
`stream.el` provides an implementation of streams, implemented as delayed
evaluation of cons cells.`stream.el` requires Emacs >= 25.1.
Functions defined in [seq.el](https://github.com/NicolasPetton/seq.el) can also take a stream as input.
Streams could be created from any sequential input data:
- sequences, making operation on them lazy
- a set of 2 forms (first and rest), making it easy to represent infinite sequences
- buffers (by character)
- buffers (by line)
- buffers (by page)
- IO streams
- orgmode table cells
- ...All functions are prefixed with "stream-".
All functions are tested in test/stream-tests.elHere is an example implementation of the Fibonacci numbers
implemented as in infinite stream:(defun fib (a b)
(stream-cons a (fib b (+ a b))))
(fib 0 1)## Functions
As well as working all functions defined in seq.el, stream.el provides the
following stream-specifec functions:- `stream` src
This function returns a new stream from `src`. This generic method can be
extended, and supports out of the box lists, strings, arrays and buffers as
input.- `stream-cons` first rest
This macro returns a stream built from the cons of `first` and `rest`.
`first` and `rest` are forms and `rest` must return a stream.- `seq-make` body
This macro returns a stream built from `body`. `body` must return nil or a
cons cell, which cdr is itself a stream.## Contributing
Since this library is in GNU ELPA, contributors must have signed the Emacs
Copyright assignment.Fetch dependencies:
$ cd /path/to/stream.el
$ caskRun the tests:
$ ./run-tests.sh
[COPYING]: ./COPYING