The fare-mop Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The fare-mop Reference Manual

This is the fare-mop Reference Manual, version 1.0.1, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:45:31 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

fare-mop has a few simple utilities relying on the MOP.
It depends on CLOSER-MOP for portable MOP access.

The main utilities are:

SIMPLE-PRINT-OBJECT-MIXIN
	class mixin to give you a useful PRINT-OBJECT method for free

SIMPLE-PRINT-OBJECT
	a simple PRINT-OBJECT function you can use it without the mixin
        (useful when you don't want to change the class hierarchy of
        some library you're using, but still want to simply inspect objects
        and/or define a PRINT-OBJECT method on them).

COLLECT-SLOTS
	a utility used by the above function, to collect a p-list
        describing the slots bound in an object

SLOTS-TO-PRINT
	a way to customize which slots get printed by SIMPLE-PRINT-OBJECT-MIXIN


Other utilities include:        

REMAKE-OBJECT
	a utility for "copying" objects by calling make-instance with
        the "same" initialization arguments as an original objects,
        plus overriding keyword arguments.
        Useful for experimenting with a pure functional OO style.
        Not for use where performance is important.

See documentation strings for details.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

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


Previous: , Up: Systems   [Contents][Index]

2.1 fare-mop

Author

Francois-Rene Rideau

Description

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

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
Source

fare-mop.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

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


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 fare-mop.asd

Location

fare-mop.asd

Systems

fare-mop (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 fare-mop/package.lisp

Parent

fare-mop (system)

Location

package.lisp

Packages

fare-mop


Previous: , Up: Lisp files   [Contents][Index]

3.1.3 fare-mop/utilities.lisp

Dependency

package.lisp (file)

Parent

fare-mop (system)

Location

utilities.lisp

Exported Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 fare-mop

Source

package.lisp (file)

Use List
Exported Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

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


Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 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 (file)

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 (file)

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 (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Generic functions

Generic Function: slots-to-print OBJECT
Package

fare-mop

Source

utilities.lisp (file)

Methods
Method: slots-to-print OBJECT

Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 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 (file)

Direct superclasses

standard-object (class)

Direct methods

print-object (method)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L  
Index Entry  Section

F
fare-mop.asd: The fare-mop<dot>asd file
fare-mop/package.lisp: The fare-mop/package<dot>lisp file
fare-mop/utilities.lisp: The fare-mop/utilities<dot>lisp file
File, Lisp, fare-mop.asd: The fare-mop<dot>asd file
File, Lisp, fare-mop/package.lisp: The fare-mop/package<dot>lisp file
File, Lisp, fare-mop/utilities.lisp: The fare-mop/utilities<dot>lisp file

L
Lisp File, fare-mop.asd: The fare-mop<dot>asd file
Lisp File, fare-mop/package.lisp: The fare-mop/package<dot>lisp file
Lisp File, fare-mop/utilities.lisp: The fare-mop/utilities<dot>lisp file

Jump to:   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   C   F   G   M   R   S  
Index Entry  Section

C
collect-slots: Exported functions

F
Function, collect-slots: Exported functions
Function, remake-object: Exported functions
Function, simple-print-object: Exported functions

G
Generic Function, slots-to-print: Exported generic functions

M
Method, slots-to-print: Exported generic functions

R
remake-object: Exported functions

S
simple-print-object: Exported functions
slots-to-print: Exported generic functions
slots-to-print: Exported generic functions

Jump to:   C   F   G   M   R   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables


Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   F   P   S  
Index Entry  Section

C
Class, simple-print-object-mixin: Exported classes

F
fare-mop: The fare-mop system
fare-mop: The fare-mop package

P
Package, fare-mop: The fare-mop package

S
simple-print-object-mixin: Exported classes
System, fare-mop: The fare-mop system

Jump to:   C   F   P   S