Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the dynamic-mixins Reference Manual, version 0.0, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:43:19 2018 GMT+0.
• Introduction: | What dynamic-mixins is all about | |
• Systems: | The systems documentation | |
• Files: | The files documentation | |
• Packages: | The packages documentation | |
• Definitions: | The symbols documentation | |
• Indexes: | Concepts, functions, variables and data types |
Dynamic-mixins is for simple, dynamic class combination:
(in-package :dynamic-mixins)
(defclass a () ())
(defclass b () ())
(defclass c () ())
(make-instance (mix 'a 'b)) ;; => #<MIXIN-OBJECT (A B)>
(let ((a (make-instance 'a)))
(ensure-mix a 'b 'c) ;; => #<MIXIN-OBJECT (B C A)>
(delete-from-mix a 'a) ;; => #<MIXIN-OBJECT (B C)>
(delete-from-mix a 'c)) ;; => #<B>
This allows objects to be mixed and updated without manually defining many permutations.
MIX &rest classes
: This produces a "mix
list", which is generally only useful for passing to
MAKE-INSTANCE
. Note: Order matters! This determines class
precedence.
ENSURE-MIX object &rest name-or-class
: Ensure that classes listed
in name-or-class
are part of object
. This will create a new
class and CHANGE-CLASS object
if necessary. Note: Order matters!
This determines class precedence.
DELETE-FROM-MIX object &rest name-or-class
: Remove classes listed
in name-or-class
from the object's class. This will create a new
class and CHANGE-CLASS object
if necessary. However, object
must be a MIXIN-OBJECT
created by (MAKE-INSTANCE (MIX ...) ...)
or ENSURE-MIX
. Otherwise, nothing will be changed.
Order matters; you are defining a new class which has the specified classes as direct superclasses.
ENSURE-MIX
prepends classes in the order specified. (Originally,
it appended classes.) This is simply more useful in practice:
(defclass general-object () ())
(defclass specializing-mixin () ())
(defgeneric some-operation (x))
(defmethod some-operation (x)
"Handle the general case"
...)
(defmethod some-operation ((x specializing-mixin))
"Handle the case for SPECIALIZING-MIXIN"
...)
(let ((x (make-instance 'general-object)))
(ensure-mix x 'specializing-mixin)
(some-operation x))
If SPECIALIZING-MIXIN
were appended, the method which specialized on
it would never be called. In practice, this defeats the point.
Therefore, mixins now get precedence.
Errors regarding precendence and circularity are now handled, or rather, causing such an error will not produce a nearly-unrecoverable situation. Now you will just get an error.
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The dynamic-mixins system: |
Ryan Pavlik
BSD-2-Clause
Simple dynamic class mixing without manual permutations
0.0
dynamic-mixins.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files: |
• The dynamic-mixins.asd file: | ||
• The dynamic-mixins/package.lisp file: | ||
• The dynamic-mixins/dynamic-mixins.lisp file: |
Next: The dynamic-mixins/package<dot>lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
/home/quickref/quicklisp/dists/quicklisp/software/dynamic-mixins-20141106-git/dynamic-mixins.asd
dynamic-mixins (system)
Next: The dynamic-mixins/dynamic-mixins<dot>lisp file, Previous: The dynamic-mixins<dot>asd file, Up: Lisp files [Contents][Index]
dynamic-mixins (system)
package.lisp
Previous: The dynamic-mixins/package<dot>lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
dynamic-mixins (system)
dynamic-mixins.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The dynamic-mixins.asdf package: | ||
• The dynamic-mixins package: |
Next: The dynamic-mixins package, Previous: Packages, Up: Packages [Contents][Index]
/home/quickref/quicklisp/dists/quicklisp/software/dynamic-mixins-20141106-git/dynamic-mixins.asd
Previous: The dynamic-mixins<dot>asdf package, Up: Packages [Contents][Index]
package.lisp (file)
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions: | ||
• Internal definitions: |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported functions: | ||
• Exported classes: |
Next: Exported classes, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
dynamic-mixins.lisp (file)
dynamic-mixins.lisp (file)
dynamic-mixins.lisp (file)
Previous: Exported functions, Up: Exported definitions [Contents][Index]
dynamic-mixins.lisp (file)
standard-class (class)
:classes
dynamic-mixins.lisp (file)
standard-object (class)
print-object (method)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables: | ||
• Internal functions: | ||
• Internal structures: |
Next: Internal functions, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
dynamic-mixins.lisp (file)
Next: Internal structures, Previous: Internal special variables, Up: Internal definitions [Contents][Index]
dynamic-mixins.lisp (file)
Create a MIX-LIST for MAKE-INSTANCE. The first element may be an instance; further elements must be class names or classes.
dynamic-mixins.lisp (file)
dynamic-mixins.lisp (file)
dynamic-mixins.lisp (file)
dynamic-mixins.lisp (file)
dynamic-mixins.lisp (file)
dynamic-mixins.lisp (file)
dynamic-mixins.lisp (file)
dynamic-mixins.lisp (file)
Previous: Internal functions, Up: Internal definitions [Contents][Index]
dynamic-mixins.lisp (file)
structure-object (structure)
make-instance (method)
mix-list-list (function)
(setf mix-list-list) (function)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index: | ||
• Function index: | ||
• Variable index: | ||
• Data type index: |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | D F L |
---|
Jump to: | D F L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | %
(
C D E F M S |
---|
Jump to: | %
(
C D E F M S |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
C L S |
---|
Jump to: | *
C L S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C D M P S |
---|
Jump to: | C D M P S |
---|