The clutter Reference Manual

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

The clutter Reference Manual

This is the clutter Reference Manual, version 1.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Thu Sep 15 04:26:23 2022 GMT+0.

Table of Contents


1 Introduction

Clutter

Annotations/decorators/attributes for CLOS classes and slots

Clutter is a library to allow us Lispers to, well, clutter our beautiful CLOS classes and their slots with additional information (attributes or, as they're called in other languages, annotations or decorators).

One may thus define a class like the following:

(defclass my-class (my-superclass)
  ((some-slot :attributes ((pretty-name . "My precious") (validator . #'valid-treasure-p))))
  (:attributes (pretty-name . "My class") (version . "1.1"))
  (:metaclass clutter:standard-class-with-attributes))

Then, we can query the class and slot for information about their attributes:

(attribute 'pretty-name 'my-class) => "My class"
(attribute 'pretty-name (slot 'some-slot 'my-class)) => "My precious"

attribute is also a SETFable place.

Note that attributes in subclasses can override attributes in superclasses.

Internally, attributes are stored in hash tables. However, for convenience, we provide them as alists in defclass forms.

Note that defclass doesn't evaluate the attributes. If they're not literal constants you have to set them programmatically with setf attribute.

Also note that effective attributes are computed by finalize-inheritance, which is invoked by the MOP at some point between the declaration of the class and the creation of its first instance. When in doubt, call finalize-inheritance manually to ensure that you can query and update attributes.


2 Systems

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


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

2.1 clutter

Cluttering classes and slots with annotations/decorators/attributes metadata

Author

Alessio Stalla

License

LGPL

Version

1.0.0

Dependencies
  • closer-mop (system).
  • doplus (system).
Source

clutter.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


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

3.1 clutter/src

Source

clutter.asd.

Parent Component

clutter (system).

Child Components

4 Files

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


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

4.1 Lisp


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

4.1.1 clutter/clutter.asd

Source

clutter.asd.

Parent Component

clutter (system).

ASDF Systems

clutter.


4.1.2 clutter/src/packages.lisp

Source

clutter.asd.

Parent Component

src (module).

Packages

clutter.


4.1.3 clutter/src/clutter.lisp

Source

clutter.asd.

Parent Component

src (module).

Public Interface
Internals

5 Packages

Packages are listed by definition order.


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

5.1 clutter

Source

packages.lisp.

Use List
  • common-lisp.
  • doplus.
Public Interface
Internals

6 Definitions

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


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

6.1 Public Interface


6.1.1 Ordinary functions

Function: attribute (name attributed-element)
Package

clutter.

Source

clutter.lisp.

Function: (setf attribute) (name attributed-element)
Package

clutter.

Source

clutter.lisp.

Function: slot (name class)
Package

clutter.

Source

clutter.lisp.


6.1.2 Generic functions

Generic Function: attributes-of (object)
Package

clutter.

Methods
Method: attributes-of (anything)
Source

clutter.lisp.

Method: attributes-of ((c symbol))
Source

clutter.lisp.

Reader Method: attributes-of ((-with-attributes -with-attributes))

automatically generated reader method

Source

clutter.lisp.

Target Slot

attributes.

Generic Writer: (setf attributes-of) (object)
Package

clutter.

Methods
Writer Method: (setf attributes-of) ((-with-attributes -with-attributes))

automatically generated writer method

Source

clutter.lisp.

Target Slot

attributes.


6.1.3 Standalone methods

Method: compute-effective-slot-definition ((class standard-class-with-attributes) name direct-slot-definitions)
Package

sb-mop.

Source

clutter.lisp.

Method: direct-slot-definition-class ((class standard-class-with-attributes) &rest initargs)
Package

sb-mop.

Source

clutter.lisp.

Method: effective-slot-definition-class ((class standard-class-with-attributes) &rest initargs)
Package

sb-mop.

Source

clutter.lisp.

Method: finalize-inheritance :after ((class -with-attributes))
Package

sb-mop.

Source

clutter.lisp.

Method: validate-superclass ((class standard-class-with-attributes) (superclass standard-class))
Package

sb-mop.

Source

clutter.lisp.


6.1.4 Classes

Class: -with-attributes

Mixin for elements that can have attributes

Package

clutter.

Source

clutter.lisp.

Direct subclasses
Direct methods
Direct slots
Slot: attributes
Initform

(make-hash-table)

Initargs

:attributes

Readers

attributes-of.

Writers

(setf attributes-of).

Class: standard-class-with-attributes
Package

clutter.

Source

clutter.lisp.

Direct superclasses
Direct methods

6.2 Internals


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

6.2.1 Ordinary functions

Function: attributes->hash-table (attributes)
Package

clutter.

Source

clutter.lisp.

Function: merge-attributes (instance &rest ancestors)
Package

clutter.

Source

clutter.lisp.


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

6.2.2 Generic functions

Generic Reader: ancestors (object)
Package

clutter.

Methods
Reader Method: ancestors ((merged-attributes merged-attributes))

automatically generated reader method

Source

clutter.lisp.

Target Slot

ancestors.

Generic Function: get-attribute (map name)
Package

clutter.

Source

clutter.lisp.

Methods
Method: get-attribute ((map merged-attributes) name)
Method: get-attribute ((map hash-table) name)
Generic Reader: own-attributes (object)
Package

clutter.

Methods
Reader Method: own-attributes ((merged-attributes merged-attributes))

automatically generated reader method

Source

clutter.lisp.

Target Slot

own-attributes.

Generic Function: set-attribute (map name value)
Package

clutter.

Source

clutter.lisp.

Methods
Method: set-attribute ((map merged-attributes) name value)
Method: set-attribute ((map hash-table) name value)

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

6.2.3 Classes

Class: direct-slot-definition-with-attributes
Package

clutter.

Source

clutter.lisp.

Direct superclasses
Class: effective-slot-definition-with-attributes
Package

clutter.

Source

clutter.lisp.

Direct superclasses
Class: merged-attributes
Package

clutter.

Source

clutter.lisp.

Direct methods
Direct slots
Slot: own-attributes
Initargs

:own

Readers

own-attributes.

Writers

This slot is read-only.

Slot: ancestors
Initargs

:ancestors

Readers

ancestors.

Writers

This slot is read-only.


Appendix A Indexes


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

A.1 Concepts


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

A.2 Functions

Jump to:   (  
A   C   D   E   F   G   M   O   S   V  
Index Entry  Section

(
(setf attribute): Public ordinary functions
(setf attributes-of): Public generic functions
(setf attributes-of): Public generic functions

A
ancestors: Private generic functions
ancestors: Private generic functions
attribute: Public ordinary functions
attributes->hash-table: Private ordinary functions
attributes-of: Public generic functions
attributes-of: Public generic functions
attributes-of: Public generic functions
attributes-of: Public generic functions

C
compute-effective-slot-definition: Public standalone methods

D
direct-slot-definition-class: Public standalone methods

E
effective-slot-definition-class: Public standalone methods

F
finalize-inheritance: Public standalone methods
Function, (setf attribute): Public ordinary functions
Function, attribute: Public ordinary functions
Function, attributes->hash-table: Private ordinary functions
Function, merge-attributes: Private ordinary functions
Function, slot: Public ordinary functions

G
Generic Function, (setf attributes-of): Public generic functions
Generic Function, ancestors: Private generic functions
Generic Function, attributes-of: Public generic functions
Generic Function, get-attribute: Private generic functions
Generic Function, own-attributes: Private generic functions
Generic Function, set-attribute: Private generic functions
get-attribute: Private generic functions
get-attribute: Private generic functions
get-attribute: Private generic functions

M
merge-attributes: Private ordinary functions
Method, (setf attributes-of): Public generic functions
Method, ancestors: Private generic functions
Method, attributes-of: Public generic functions
Method, attributes-of: Public generic functions
Method, attributes-of: Public generic functions
Method, compute-effective-slot-definition: Public standalone methods
Method, direct-slot-definition-class: Public standalone methods
Method, effective-slot-definition-class: Public standalone methods
Method, finalize-inheritance: Public standalone methods
Method, get-attribute: Private generic functions
Method, get-attribute: Private generic functions
Method, own-attributes: Private generic functions
Method, set-attribute: Private generic functions
Method, set-attribute: Private generic functions
Method, validate-superclass: Public standalone methods

O
own-attributes: Private generic functions
own-attributes: Private generic functions

S
set-attribute: Private generic functions
set-attribute: Private generic functions
set-attribute: Private generic functions
slot: Public ordinary functions

V
validate-superclass: Public standalone methods

Jump to:   (  
A   C   D   E   F   G   M   O   S   V  

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

A.3 Variables

Jump to:   A   O   S  
Index Entry  Section

A
ancestors: Private classes
attributes: Public classes

O
own-attributes: Private classes

S
Slot, ancestors: Private classes
Slot, attributes: Public classes
Slot, own-attributes: Private classes

Jump to:   A   O   S