- Argument Conventions
- TinyClos Introspection
- Bugs and Limitations
- Version history
Some coops stuff.
Miscellaneous coops extensions.
INSTANCE is a coops-instance.
SLOT is a symbol.
INITFORM is 'SLOT OBJECT.
The slot accessor recursion.
- (slot@ INSTANCE SLOT ...) --> *syntax
Returns the slot value of the N'th named slot from INSTANCE.
- (slot@ INSTANCE SLOT ... [= OBJECT])syntax
Sets the slot value of the N'th named slot of INSTANCE to OBJECT.
(use coops coops-extras) ;Needlessly complex for example (define-class <first> () (next)) (define-class <second> (<first>) ()) (define-class <third> (<second>) ()) (define 1st (make <first> 'next (make <second> 'next (make <third> 'next "the end")))) (slot@ 1st next next next) ;=> "the end" (slot@ 1st next next next = "still the end") (slot@ 1st next next next) ;=> "still the end"
(From '@' macro by Dan Muresan.)
- (make/copy INSTANCE [INITFORM ...]) --> coops-instanceprocedure
Returns a copy of the object INSTANCE except where an INITFORM overrides an existing SLOT value of the INSTANCE.
- describe-object INSTANCE #!optional OUT current-output-portprocedure
Prints information about the INSTANCE to the output-port OUT.
describe-object is a generic-procedure specializing the first argument.
A more detailed print-object for use in a REPL.
- (describe-object-slot INSTANCE SLOT [NAME-MAXLEN 32 [OUT (current-output-port)]])procedure
Prints information about the INSTANCE's SLOT to the output-port OUT. Does not append a (newline).
NAME-MAXLEN is the maximum number of single-width characters in a slotname.
Some TInyCLOS inspired property readers.
Provides predicates and read accessors for coops objects.
OBJECT is a Scheme object.
CLASS is a coops class.
GENERIC is a coops generic-procedure.
METHOD is a coops generic-procedure method. Do not apply any but the supplied API to instances of this type!
- instance-of? OBJECT CLASSprocedure
Is OBJECT an instance of the CLASS>?
- class? OBJECTprocedure
Is OBJECT an instance of the <standard-class>?
- instance? OBJECTprocedure
Is OBJECT an instance of a basic class. Neither an instance of the <standard-class> or a primitive such as boolean or vector?
- primitive-instance? OBJECTprocedure
Is OBJECT an instance of the <primitive-object> class?
- generic? OBJECTprocedure
Synonym for generic-procedure?.
- method? OBJECTprocedure
Is OBJECT a method of a generic-procedure?
"Note" that the current implementation of methods does not depend on the type system. This function only validates the form of the argument and can be fooled.
- class-precedence-list CLASSprocedure
Returns the superclasses of CLASS.
- class-slots CLASSprocedure
Returns the slot names of CLASS.
- class-direct-supers CLASSprocedure
Returns the uninherited superclasses of CLASS.
- class-direct-slots CLASSprocedure
Returns the uninherited slot names of CLASS.
- generic-anonymous? GENERICprocedure
Is GENERIC an unnamed generic-procedure.
- generic-name GENERICprocedure
Returns the name of GENERIC. The name is #f for an anonymous generic procedure.
- generic-specialized-arguments GENERICprocedure
The arguments that GENERIC is specialized upon.
- generic-primary-methods GENERICprocedure
Returns the list of #:primary methods for GENERIC.
- generic-before-methods GENERICprocedure
Returns the list of #:before methods for GENERIC.
- generic-after-methods GENERICprocedure
Returns the list of #:after methods for GENERIC.
- generic-around-methods GENERICprocedure
Returns the list of #:around methods for GENERIC.
- method-specializers METHODprocedure
Returns the classes that specialize METHOD.
- method-procedure METHODprocedure
Returns the procedure for METHOD.
- class-cpl CLASSprocedure
- class-supers CLASSprocedure
- primitive? OBJECTprocedure
- generic-methods GENERICprocedure
(use coops coops-introspection) (define (print-methods generic) (for-each (lambda (m) (print (generic-name generic) " specialized by " (method-specializers m) " as " (method-procedure m))) (generic-primary-methods generic)) )
- The introspection API is brittle, especially the generics portion.
Suggested only for use during REPL development with coops.
- Collect TinyCLOS synonyms in own module: coops-introspection-tinyclos; reexport by coops-utils DEPRECATED.
- Remove test, remove inlines.
- Add test, fix library requirement.
- Fix make/copy for objects with uninitialized slots, thanks to Sandra Snan
- Fix class-direct-supers and class-direct-slots, minor internal optimization.
- Release for coops 1.92
- * UNMAINTAINED *
Copyright (C) 2010-2017 Kon Lovett. All rights reserved.
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 ASIS, 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 SOFTWARE.