The fare-mop Reference Manual

This is the fare-mop Reference Manual, version 1.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 16:23:22 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 fare-mop

Utilities using the MOP; notably make informative pretty-printing trivial

Author

Francois-Rene Rideau

Long Description

fare-mop is a small collection of utilities using the MOP.
It notably contains a method SIMPLE-PRINT-OBJECT, and
a mixin SIMPLE-PRINT-OBJECT-MIXIN that allow you to trivially define PRINT-OBJECT methods that print the interesting slots in your objects, which is great for REPL interaction and debugging.

Version

1.0.1

Dependencies
  • fare-utils (system)., at least version "1.0.0"
  • closer-mop (system).
Source

fare-mop.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 fare-mop/fare-mop.asd

Source

fare-mop.asd.

Parent Component

fare-mop (system).

ASDF Systems

fare-mop.


3.1.2 fare-mop/package.lisp

Source

fare-mop.asd.

Parent Component

fare-mop (system).

Packages

fare-mop.


3.1.3 fare-mop/utilities.lisp

Dependency

package.lisp (file).

Source

fare-mop.asd.

Parent Component

fare-mop (system).

Public Interface

4 Packages

Packages are listed by definition order.


4.1 fare-mop

Source

package.lisp.

Use List
  • closer-common-lisp.
  • fare-utils.
  • uiop/driver.
Public Interface

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Ordinary functions

Function: collect-slots (object &key slots)

Given an OBJECT and SLOTS designating a list of slot designators, return a p-list of an INITARG and VALUE
for each of those of the specified slots that are bound.
A slot designator may be a SLOT-DEFINITION object,
a KEYWORD specifying the INITARG of the slot,
or a SYMBOL naming the slot.
If the slot has no INITARG, the slot name is used instead in the p-list

Package

fare-mop.

Source

utilities.lisp.

Function: remake-object (object &rest keys &key &allow-other-keys)

A function to build a new object of the same class as OBJECT,
initialized with the specified KEYS, plus keys deduced from the original object by those slots that both are bound and have a defined initarg.
Note: this function is useful for experimental programming,
but use of runtime introspection means
this function isn’t suited where performance is important.

Package

fare-mop.

Source

utilities.lisp.

Function: simple-print-object (object stream &key identity slots)

This function will introspect you object’s slots to print it.
You can call it explicitly from your print-object methods,
or implicitly by just inheritting from SIMPLE-PRINT-OBJECT-MIXIN.
If SLOTS is T (the default), print all slots as per CLOSER-MOP:COMPUTE-SLOTS. If SLOTS is a list of slot designators, print them.
Slots are printed as a p-list as per FARE-MOP:COLLECT-SLOTS.
The IDENTITY keyword is as per PRINT-UNREADABLE-OBJECT.

Package

fare-mop.

Source

utilities.lisp.


5.1.2 Generic functions

Generic Function: slots-to-print (object)
Package

fare-mop.

Source

utilities.lisp.

Methods
Method: slots-to-print (object)

5.1.3 Standalone methods

Method: print-object ((object simple-print-object-mixin) stream)
Source

utilities.lisp.


5.1.4 Classes

Class: simple-print-object-mixin

Mixin to trivially give a print-object method to your class.
If you don’t want to print all slots, define a method on FARE-MOP:SLOTS-TO-PRINT to return a list of slot designators for those slots you want to print,
as per FARE-MOP:COLLECT-SLOTS.

Package

fare-mop.

Source

utilities.lisp.

Direct methods

print-object.


Appendix A Indexes


A.1 Concepts


A.3 Variables