Skip to content

DMClVG/lisp_iter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

lisp_iter

crates.io

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(123)
    println!("{:?}", list.next().unwrap()); // Quote("wow")
}

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages