Expand description

A Scheme parsing and evaluation framework.

Example

use parsley::run;

assert_eq!(
    run("(null? '())").unwrap(),
    run("#t").unwrap()
);

assert_eq!(
    run("(* (+ 3 4 5) (- 5 2))").unwrap(),
    run("36").unwrap()
);

let expr = r#"
(define (sqr x) (* x x))
(define (sum-of-squares x y) (+ (sqr x) (sqr y)))
(sum-of-squares 3 4)
"#;
assert_eq!(
    run(expr).unwrap(),
    run("25").unwrap()
);

Modules

Quick access to the important stuff.

Utilities for writing LISP procedures in Rust.

Macros

Evaluate one or more S-Expressions, in the base context or your own custom one.

Construct an S-Expression from a list of expressions.

Structs

Evaluation context for LISP expressions.

Enums

Multipurpose error type.

A numeric type that adapts its precision based on its usage.

An S-Expression. Can be parsed from a string via FromStr, or constructed programmatically.

Functions

Run a code snippet in the base context.

Type Definitions

A shorthand Result type.