lisp_iter

Crates.iolisp_iter
lib.rslisp_iter
version0.1.0
sourcesrc
created_at2022-11-02 20:44:56.427444
updated_at2022-11-02 20:44:56.427444
descriptionSingle-pass no-alloc iterator for simple lisp or lisp-like expressions
homepage
repositoryhttps://github.com/DMClVG/lisp_iter
max_upload_size
id703747
size8,161
AV (DMClVG)

documentation

README

lisp_iter

Single-pass no-alloc iterator for simple lisp or lisp-like expressions.

use lisp_iter::LispIter;

fn main() {
    let mut iter = LispIter::new(r#"(this-is-a-identifier :a 123 "wow") ; :a is shorthand for "a" "#);
    let mut list = iter.next().unwrap().into_iter(); // Retrieve first list in iterator

    println!("{:?}", list.next().unwrap()); // Identifier("this-is-a-identifier")
    println!("{:?}", list.next().unwrap()); // Quote("a")
    println!("{:?}", list.next().unwrap()); // Integer(0)
    println!("{:?}", list.next().unwrap()); // Quote("wow")
}

Useful to glance over anything lispy with minimal to 0 overhead.

Commit count: 4

cargo fmt