Crate spaik

Crate spaik 

Source
Expand description

§The SPAIK-LISP Programming Language

This is the documentation for SPAIK an embeddable Lisp dialect for Rust.

(dolist (x '(this new unknown))
  (println "Hello, {x} World!"))
Hello, this World!
Hello, new World!
Hello, unknown World!

§Running SPAIK from Rust

use spaik::Spaik;

let mut vm = Spaik::new();
vm.exec(r#"(println "code")"#).unwrap();
let res: f32 = vm.eval(r#"(sqrt (+ 1 2))"#).unwrap();

Re-exports§

pub use crate::error::Error;
pub use crate::error::Result;

Modules§

error
Structured Errors
prelude
The easiest way to get started with SPAIK is use spaik::prelude::*
proc_macro_deps
This is NOT a public interface. Dependencies for procedural macros (feature “derive”.)
repl
Interactive Read-Eval-Print-Loop

Structs§

ExampleObject
Object for use in SPAIK examples
Gc
Thread-safe reference-counted smart-pointer. Cheap to clone. Used to refer to Userdata stored on the SPAIK heap.
Ignore
A type that all SPAIK values may be converted to.
Promise
Promise made to SpaikPlug
SPV
Safe Primitive Value, a way of safely referring to GC storage
Spaik
A SPAIK Context, this is the main way to use SPAIK
SpaikPlug
Asynchronous SPAIK, in another thread
Sym

Enums§

Builtin
Event

Traits§

Args
AsSym
EnumCall
Fissile
Structs that can be stored inline in the GC Arena memory must implement this trait.
FromLisp
The mem parameter is necessary here, because some of the conversions may need to create an SPV reference-counter
IntoLisp
The mem parameter is necessary here, because some of the conversions may need to do memory allocation.
IntoSubr
Subr
Userdata

Functions§

minify
Remove unneeded whitespace from SPAIK code.
run_tests
Run SPAIK tests from the ./tests directory and report any errors.
scratch_main
SPAIK scratchpad for use in development of SPAIK itself. Rust doesn’t have a good REPL, this is my substitute. Changes to this file should not be commited to git.

Type Aliases§

Str

Attribute Macros§

spaikfn

Derive Macros§

EnumCall
Fissile