make-duplicate-instance |
| instance &rest initargs&key &allow-other-keys | [Generic Function] |
Purpose
Create a duplicate instance of instance.
Method signatures
( instance standard-object)
unduplicated-slot-names
&rest initargs
|
( instance standard-space-instance)
unduplicated-slot-names
&rest initargs
|
( instance standard-unit-instance)
unduplicated-slot-names
&rest initargs
|
:around
( instance standard-unit-instance)
unduplicated-slot-names
&rest initargs
|
Package :gbbopen-tools
(re-exported by :gbbopen
Module :gbbopen-tools
(the unit-instance and
space-instance methods are added by :gbbopen-core
Arguments and values
instance | A standard-object instance
| |
unduplicated-slot-names | A list of slot names | |
initargs | An initialization argument list | |
new-instance | A standard-object instance
| |
slots | A proper list of slot objects |
Returns
Two values: the (newly created) duplicate instance and a
list of the slots that were duplicated or explicitly initialized.
Events
When a unit instance is duplicated, events are signaled in the
following sequence:
nonlink-slot-updated-event
link-event
link-event
instance-added-to-space-instance-event
instance-created-event
is signaled.
Errors
Use of an initialization argument that has not been declared as valid.
Description
Slot initialization during instance duplication behaves as follows, regardless
of whether the slots are local or shared:
:initform
When duplicating a unit instance, specifying a
:instance-name
:use-global-instance-name-counter
nil
or was not specified for the unit class) or the global
instance-name counter value (if the
:use-global-instance-name-counter
A :space-instances
See also
change-class
delete-instance
describe-instance
initial-class-instance-number
instance-name-of
make-duplicate-instance-changing-class
make-instance
make-space-instance
next-class-instance-number
unduplicated-slot-names
Examples
Create some simple duplicate instances:
> (define-class foo () ((a :initform 1) (b :initform 2))) #<standard-class foo> > (defparameter *x* (make-instance 'foo :a 11 :b 12)) *x* > :ds *x* #<foo #x110fe6ea> is an instance of #<standard-class foo>: The following slots have :instance allocation: a 11 b 12 > :ds (make-duplicate-instance *x* nil :a -1) #<foo #x110ff93a> is an instance of #<standard-class foo>: The following slots have :instance allocation: a -1 b 12 > :ds (make-duplicate-instance *x* '(b) :a -1) #<foo #x11104542> is an instance of #<standard-class foo>: The following slots have :instance allocation: a -1 b 2 > :ds (make-duplicate-instance *x* '(b)) #<foo #x11108c82> is an instance of #<standard-class foo>: The following slots have :instance allocation: a 11 b 2 > (make-duplicate-instance *x* nil) #<foo @ #x1110a0e2> (#<standard-effective-slot-definition b> #<standard-effective-slot-definition a>) >
Create a duplicate of the hyp
419
unit instance:
> (make-duplicate-instance (find-instance-by-name 19 'hyp) nil) #<hyp 681 (1835 4791) 0.85 [5..35]> >
The GBBopen Project
make-duplicate-instance |