Table of Contents

MiniLisp

Many years working with Lush have taken their toll.
There are many things I really dislike doing in C or C++
when I know how easy they would be in Lisp.
The essential lisp data structure is called the S-Expression.
S-Expressions can represent lots of complicated things
using a simple printable format. These are the main
reason why many people find XML or JSON appealing.
But I keep returning to S-Expression because they are so much simpler.

MiniExp

At some point I decided to simply write a C++ library
to handle the basic lisp data structure: S-expressions.
The implementation fits in a single C++ file,
including a garbage collector and a pretty printer.
The full documentation is available as comments in
the header file miniexp.h

MiniExp handles four basic types of S-expressions:

Integers, in range [-229…229-1].

Symbols, which are small strings represented by a unique handle.

Pairs, which are the basic components of lists.

Objects, which encapsulate any C++ object derived from class miniobj_t

The type of the S-expression is miniexp_t.
But we often store them into variables of type minivar_t.
The difference is garbage collection.
The garbage collector preserves all S-expressions stored in a minivar_t
and all S-expressions recursively pointed by preserved S-expresssions.