# exlisp v0.1.2 - Table of Contents

> A Lisp implementation and REPL running on Elixir/BEAM

## Modules

- [BuiltinFunction](BuiltinFunction.md): Module responsible for determining ExLisp built-in functions
and compiling them to Erlang Abstract Format.

- [ExLisp](ExLisp.md): Documentation for `ExLisp`.

- [ExLisp.ASDF](ExLisp.ASDF.md): Lightweight loader for Common Lisp ASDF (Another System Definition Facility).
Parses defsystem definitions in `.asd` files, resolves dependencies,
and loads components (`.lisp` files) in sequential order.

- [ExLisp.Builtins](ExLisp.Builtins.md): Implementation module for Common Lisp (SBCL-compliant) built-in functions and predicates.

- [ExLisp.CLFormat](ExLisp.CLFormat.md): ANSI Common Lisp `format` control string engine for ExLisp.
Supports:
- ~A, ~S, ~C, ~W (Aesthetic, Standard, Character, Write)
- ~D, ~B, ~O, ~X, ~R (Decimal, Binary, Octal, Hex, Radix/English/Roman)
- ~P (Pluralization: s, ies, with modifiers)
- ~F, ~E, ~G, ~$ (Floating point, Exponential, Monetary)
- ~%, ~&, ~|, ~~ (Newlines, Fresh-line, Page, Tilde)
- ~* (Argument navigation: forward, backward, absolute)
- ~? (Indirection / nested format)
- ~[ ... ~] (Conditional selection: index, boolean, truthy)
- ~{ ... ~} (Iteration: list, sublists, remaining args, max iterations)
- ~^ (Escape / termination check)
- ~( ... ~) (Case conversion: downcase, capitalize, upcase)

- [ExLisp.CLI](ExLisp.CLI.md): ExLisp CLI entry point.
Starts an IEx-based Lisp REPL when launched with the `exlisp` command.
Also executes compilation to BEAM modules when files are specified.

- [ExLisp.CLOS](ExLisp.CLOS.md): Common Lisp Object System (CLOS) implementation for ExLisp.
Supports:
- defclass (inheritance, CPL linearization, slot inheritance, initargs, initforms, accessors, readers, writers)
- defgeneric and defmethod
- Method qualifiers: :before, :after, :around, and primary methods
- Standard Method Combination
- Multi-argument method dispatch and (eql ...) specializers
- call-next-method and next-method-p
- make-instance, slot-value, (setf slot-value), slot-boundp, slot-makunbound, slot-exists-p
- class-of, find-class, class-name, subclassp, subtypep integration

- [ExLisp.Closure](ExLisp.Closure.md): ExLisp closure and variadic function struct.
Wraps functions with lambda list keywords like &optional, &rest, &key,
enabling accurate argument dispatch.

- [ExLisp.Compiler](ExLisp.Compiler.md): Module for compiling Lisp source code into BEAM bytecode (.beam files).
Compiled modules can be used as standard Elixir / Erlang modules.

- [ExLisp.Condition](ExLisp.Condition.md): Common Lisp Condition and Restart system for ExLisp.
Supports:
- define-condition, make-condition
- signal, warn, error, cerror
- handler-bind, handler-case, ignore-errors
- restart-bind, restart-case, invoke-restart, find-restart, compute-restarts
- standard restarts: abort, continue, muffle-warning, store-value, use-value

- [ExLisp.Env](ExLisp.Env.md): Module managing global environments (variables and functions) for ExLisp.
Uses `:persistent_term` to hold and reference values and functions across sessions with extreme speed.

- [ExLisp.Formatter](ExLisp.Formatter.md): Code formatter for Common Lisp.
- [ExLisp.Hex](ExLisp.Hex.md): Hex.pm client module.
Provides functionality to dynamically download, compile, and load
Hex.pm libraries from within the REPL or Lisp scripts.

- [ExLisp.IOTracker](ExLisp.IOTracker.md): Helper module for tracking standard output during REPL evaluation and outputting
a newline (fresh-line) if no trailing newline exists at the end of evaluation.

- [ExLisp.LispParser](ExLisp.LispParser.md): Custom S-expression parser for ExLisp.
Performs lexical analysis and parsing (S-expression generation) of Lisp
without external dependencies or regular expressions.

- [ExLisp.List](ExLisp.List.md): Lisp list struct for REPL display.
Implements the Inspect protocol to output in Common Lisp format such as (A B C) or (EXPT 2 3).

- [ExLisp.Loop](ExLisp.Loop.md): Parser and transpiler for Common Lisp Extended Loop syntax.
Parses loop clauses such as `(loop for i below 5 sum i)` and expands
into standard Lisp AST (tail-recursive functions with block, let*, labels).

- [ExLisp.Macro](ExLisp.Macro.md): Common Lisp-style macro expansion system.
Provides destructuring-bind, backquote expansion, and macroexpand.

- [ExLisp.Package](ExLisp.Package.md): ANSI Common Lisp Package System for ExLisp.
Supports:
- defpackage, in-package, find-package, make-package, delete-package, rename-package
- export, unexport, import, shadow, shadowing-import, use-package, unuse-package
- intern, find-symbol, unintern, symbol-package
- package-name, package-nicknames, package-use-list, package-used-by-list, package-shadowing-symbols, list-all-packages
- package-qualified symbols (pkg:sym, pkg::sym, :keyword)

- [ExLisp.Parser](ExLisp.Parser.md): IEx parser. Inspects nested parentheses of input strings and generates AST
that invokes `ExLisp.eval/1` once top-level parentheses are closed.

- [ExLisp.Pathname](ExLisp.Pathname.md): ANSI Common Lisp Pathnames implementation for ExLisp.
Supports:
- make-pathname, pathname, pathnamep
- pathname-host, pathname-device, pathname-directory, pathname-name, pathname-type, pathname-version
- namestring, file-namestring, directory-namestring, host-namestring, enough-namestring
- parse-namestring, merge-pathnames
- truename, probe-file, file-author, file-write-date, directory, user-homedir-pathname
- wild-pathname-p, pathname-match-p

- [ExLisp.Quicklisp](ExLisp.Quicklisp.md): Quicklisp client module.
Fetches and manages Quicklisp dist metadata for Common Lisp, and handles
automatic downloading, unpacking, dependency resolution, and loading
of third-party libraries via `ql:quickload`.

- [ExLisp.Ratio](ExLisp.Ratio.md): Struct representing rational numbers (fractions) in ExLisp.

- [ExLisp.Reader](ExLisp.Reader.md): Module to split Lisp source code into top-level S-expressions (per expression).

- [ExLisp.Readtable](ExLisp.Readtable.md): ANSI Common Lisp Readtable implementation.
Supports *readtable*, copy-readtable, readtablep,
set-macro-character, get-macro-character,
set-dispatch-macro-character, get-dispatch-macro-character,
set-syntax-from-char, and readtable-case.

- [ExLisp.Stream](ExLisp.Stream.md): ANSI Common Lisp Streams implementation for ExLisp.
Supports:
- streamp, open-stream-p, input-stream-p, output-stream-p, interactive-stream-p, stream-element-type, close
- make-string-input-stream, make-string-output-stream, get-output-stream-string
- make-broadcast-stream, make-concatenated-stream, make-two-way-stream, make-echo-stream, make-synonym-stream
- broadcast-stream-streams, concatenated-stream-streams, two-way-stream-input-stream, two-way-stream-output-stream,
  echo-stream-input-stream, echo-stream-output-stream, synonym-stream-symbol
- open, file-length, file-position
- read-char, unread-char, peek-char, read-line, read-sequence
- write-char, write-string, write-line, write-sequence
- terpri, fresh_line, finish-output, force-output, clear-output, listen, clear-input

- [ExLisp.Symbol](ExLisp.Symbol.md): Lisp symbol struct for REPL display.
Implements the Inspect protocol to output symbol names without colons or quotes.

- [ExLisp.Type](ExLisp.Type.md): ANSI Common Lisp Type System implementation for ExLisp.
Supports primitive types, compound type specifiers, `deftype` user-defined types,
`typep`, `subtypep`, and type expansion.

- [LispBeam](LispBeam.md): Generates Erlang Abstract Format from ExLisp AST,
compiles it to BEAM binaries, and executes it (with interactive REPL).

