The list-named-class Reference Manual

Table of Contents

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

The list-named-class Reference Manual

This is the list-named-class Reference Manual, version 0.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Apr 28 12:22:53 2020 GMT+0.


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

1 Introduction

LIST-NAMED-CLASS

In ANSI Common Lisp, all classes must be named by symbols.

This system makes it possible to name classes by lists of symbols instead, using only standard MOP wizardry.

Tested on SBCL, ECL and CCL.

Example

LIST-NAMED-CLASS> (defclass (foo) () ())
#<LIST-NAMED-CLASS (FOO)>

LIST-NAMED-CLASS> (find-class '(foo))
#<LIST-NAMED-CLASS (FOO)>

LIST-NAMED-CLASS> (make-instance '(foo))
#<(FOO) {10116348B3}>

LIST-NAMED-CLASS> (defclass (bar) () ((slot :initarg :slot :accessor slot)))
#<LIST-NAMED-CLASS (BAR)>

LIST-NAMED-CLASS> (make-instance '(bar))
#<(BAR) {1011907C63}>

LIST-NAMED-CLASS> (setf (slot *) 42)
42

LIST-NAMED-CLASS> (slot **)
42

LIST-NAMED-CLASS> (defclass (bar baz) () ())
#<LIST-NAMED-CLASS (BAR BAZ)>

LIST-NAMED-CLASS> (defgeneric foo (bar baz)
                    (:method ((bar (bar baz)) (baz (bar baz))) 42))
#<COMMON-LISP:STANDARD-GENERIC-FUNCTION LIST-NAMED-CLASS::FOO (1)>

LIST-NAMED-CLASS> (foo (make-instance '(bar baz)) (make-instance '(bar baz)))
42

LIST-NAMED-CLASS> (defmethod foo ((bar string) (baz (bar baz))) :nook)
#<STANDARD-METHOD LIST-NAMED-CLASS::FOO
  (STRING (CLASS #<LIST-NAMED-CLASS (BAR BAZ)>)) {10181D4FB3}>

LIST-NAMED-CLASS> (foo "a" (make-instance '(bar baz)))
:NOOK

LIST-NAMED-CLASS> (defclass (parent) () ())
#<LIST-NAMED-CLASS (PARENT)>

LIST-NAMED-CLASS> (defclass (child) ((parent)) ())
#<LIST-NAMED-CLASS (CHILD)>

LIST-NAMED-CLASS> (defclass parent-2 () ())
#<STANDARD-CLASS LIST-NAMED-CLASS::PARENT-2>

LIST-NAMED-CLASS> (defclass child-2 ((parent) parent-2) ())
#<STANDARD-CLASS CHILD-2>

Usage

Package LIST-NAMED-CLASS contains symbols DEFCLASS, DEFGENERIC, DEFMETHOD, FIND-CLASS, MAKE-INSTANCE, and CHANGE-CLASS that are meant to be shadowing-imported into your package. The most convenient way to do so is to use UIOP:DEFINE-PACKAGE's :MIX option:

(uiop:define-package my-package
  (:mix #:list-named-class #:cl))

All classes named after lists are subclasses of class LIST-NAMED-CLASS.

All instances of classes named after lists are subclasses of class LIST-NAMED-INSTANCE.

License

Copyright © 2018 Michał "phoe" Herda

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE


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 list-named-class

Author

Michał "phoe" Herda <phoe@disroot.org>

License

MIT

Description

CLOS extension - name classes after lists of symbols

Version

0.1

Dependencies
Source

list-named-class.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 list-named-class.asd

Location

list-named-class.asd

Systems

list-named-class (system)


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

3.1.2 list-named-class/list-named-class.lisp

Parent

list-named-class (system)

Location

list-named-class.lisp

Packages

list-named-class

Exported Definitions
Internal Definitions

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

3.1.3 list-named-class/swank.lisp

Dependency

list-named-class.lisp (file)

Parent

list-named-class (system)

Location

swank.lisp


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

4 Packages

Packages are listed by definition order.


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

4.1 list-named-class

Source

list-named-class.lisp (file)

Use List
Exported Definitions
Internal Definitions

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

5 Definitions

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


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

5.1 Exported definitions


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

5.1.1 Macros

Macro: defclass NAME DIRECT-SUPERCLASSES DIRECT-SLOTS &rest OPTIONS
Package

list-named-class

Source

list-named-class.lisp (file)

Macro: defgeneric FUN-NAME LAMBDA-LIST &rest OPTIONS
Package

list-named-class

Source

list-named-class.lisp (file)

Macro: defmethod NAME &rest ARGS
Package

list-named-class

Source

list-named-class.lisp (file)


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

5.1.2 Functions

Function: find-class NAME &optional ERRORP ENVIRONMENT
Function: (setf find-class) NEW-VALUE NAME &optional ERRORP ENVIRONMENT
Package

list-named-class

Source

list-named-class.lisp (file)


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

5.1.3 Generic functions

Generic Function: change-class INSTANCE NEW-CLASS &rest INITARGS &key &allow-other-keys
Package

list-named-class

Source

list-named-class.lisp (file)

Methods
Method: change-class INSTANCE (NEW-CLASS symbol) &rest INITARGS &key &allow-other-keys
Method: change-class INSTANCE (NEW-CLASS cons) &rest INITARGS &key &allow-other-keys
Method: change-class (INSTANCE standard-object) (NEW-CLASS class) &rest INITARGS &key &allow-other-keys
Generic Function: make-instance CLASS &rest INITARGS &key &allow-other-keys
Package

list-named-class

Source

list-named-class.lisp (file)

Methods
Method: make-instance (CLASS symbol) &rest INITARGS &key &allow-other-keys
Method: make-instance (CLASS cons) &rest INITARGS &key &allow-other-keys
Method: make-instance (CLASS class) &rest INITARGS &key &allow-other-keys

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

5.1.4 Classes

Class: list-named-class ()
Package

list-named-class

Source

list-named-class.lisp (file)

Direct superclasses
Direct methods
  • validate-superclass (method)
  • validate-superclass (method)
  • print-object (method)
  • class-name (method)
  • class-name (method)
Direct slots
Slot: %name
Readers

class-name (generic function)

Writers

(setf class-name) (generic function)

Class: list-named-instance ()
Package

list-named-class

Source

list-named-class.lisp (file)

Direct superclasses

standard-object (class)

Direct methods

print-object (method)


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

5.2 Internal definitions


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

5.2.1 Special variables

Special Variable: *list-named-classes*
Package

list-named-class

Source

list-named-class.lisp (file)


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

5.2.2 Functions

Function: %defclass-superclasses SUPERCLASSES
Package

list-named-class

Source

list-named-class.lisp (file)

Function: %list-named-types LAMBDA-LIST
Package

list-named-class

Source

list-named-class.lisp (file)

Function: find-list-named-class NAME &optional ERRORP
Function: (setf find-list-named-class) NEW-VALUE NAME &optional ERRORP
Package

list-named-class

Source

list-named-class.lisp (file)


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

5.2.3 Classes

Class: list-named-object ()
Package

list-named-class

Source

list-named-class.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses

list-named-class (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
File, Lisp, list-named-class.asd: The list-named-class․asd file
File, Lisp, list-named-class/list-named-class.lisp: The list-named-class/list-named-class․lisp file
File, Lisp, list-named-class/swank.lisp: The list-named-class/swank․lisp file

L
Lisp File, list-named-class.asd: The list-named-class․asd file
Lisp File, list-named-class/list-named-class.lisp: The list-named-class/list-named-class․lisp file
Lisp File, list-named-class/swank.lisp: The list-named-class/swank․lisp file
list-named-class.asd: The list-named-class․asd file
list-named-class/list-named-class.lisp: The list-named-class/list-named-class․lisp file
list-named-class/swank.lisp: The list-named-class/swank․lisp file

Jump to:   F   L  

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

A.2 Functions

Jump to:   %   (  
C   D   F   G   M  
Index Entry  Section

%
%defclass-superclasses: Internal functions
%list-named-types: Internal functions

(
(setf find-class): Exported functions
(setf find-list-named-class): Internal functions

C
change-class: Exported generic functions
change-class: Exported generic functions
change-class: Exported generic functions
change-class: Exported generic functions

D
defclass: Exported macros
defgeneric: Exported macros
defmethod: Exported macros

F
find-class: Exported functions
find-list-named-class: Internal functions
Function, %defclass-superclasses: Internal functions
Function, %list-named-types: Internal functions
Function, (setf find-class): Exported functions
Function, (setf find-list-named-class): Internal functions
Function, find-class: Exported functions
Function, find-list-named-class: Internal functions

G
Generic Function, change-class: Exported generic functions
Generic Function, make-instance: Exported generic functions

M
Macro, defclass: Exported macros
Macro, defgeneric: Exported macros
Macro, defmethod: Exported macros
make-instance: Exported generic functions
make-instance: Exported generic functions
make-instance: Exported generic functions
make-instance: Exported generic functions
Method, change-class: Exported generic functions
Method, change-class: Exported generic functions
Method, change-class: Exported generic functions
Method, make-instance: Exported generic functions
Method, make-instance: Exported generic functions
Method, make-instance: Exported generic functions

Jump to:   %   (  
C   D   F   G   M  

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

A.3 Variables

Jump to:   %   *  
S  
Index Entry  Section

%
%name: Exported classes

*
*list-named-classes*: Internal special variables

S
Slot, %name: Exported classes
Special Variable, *list-named-classes*: Internal special variables

Jump to:   %   *  
S  

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

A.4 Data types

Jump to:   C   L   P   S  
Index Entry  Section

C
Class, list-named-class: Exported classes
Class, list-named-instance: Exported classes
Class, list-named-object: Internal classes

L
list-named-class: The list-named-class system
list-named-class: The list-named-class package
list-named-class: Exported classes
list-named-instance: Exported classes
list-named-object: Internal classes

P
Package, list-named-class: The list-named-class package

S
System, list-named-class: The list-named-class system

Jump to:   C   L   P   S