linkf |
| link-slot-place | [Macro] |
Purpose
Add a link between a unit instance and one
or more unit instances.
Package :gbbopen
Module :gbbopen-core
Arguments and values
link-slot-place | A form which is suitable for use as a generalized reference to a link slot | |
unit-instance-or-instances | A unit instance, a link-pointer object, or a list of unit instances and link-pointer objects |
Returns
The supplied unit-instance-or-instances.
Events
A link-event
is signaled for:
Description
Adding a link from a unit instance to another unit
instance that is already linked to that same unit instance is ignored.
See also
link-instance-of
link-setf
standard-link-pointer
unlinkf
unlinkf-all
Examples
Add support-hyp
to the
supporting-hyps
hyp
unit instance unit-instance
> (linkf (supporting-hyps-of unit-instance) support-hyp) #<hyp 231 (1488 7405) 0.63 [0..8]> >Note that, when a link pointer to
hyp
231 is already present in
a link slot, adding a link to that same hyp
unit instance—even
as a link-pointer object—has no effect on the existing link pointer:
> (supporting-hyps-of unit-instance) (#<hyp 231 (1488 7405) 0.63 [0..8]>) > (linkf (supporting-hyps-of unit-instance) (make-instance 'link-ptr-with-value :link-instance support-hyp :value 0.9)) #<link-ptr-with-value #<hyp 231 (1488 7405) 0.63 [0..8]> > (supporting-hyps-of unit-instance) (#<hyp 231 (1488 7405) 0.63 [0..8]>) >This time, add a link-pointer object as a new pointer:
> (unlinkf-all (supporting-hyps-of unit-instance)) nil > (linkf (supporting-hyps-of unit-instance) (make-instance 'link-ptr-with-value :link-instance support-hyp :value 0.9)) #<link-ptr-with-value #<hyp 231 (1488 7405) 0.63 [0..8]> > (supporting-hyps-of unit-instance) (#<link-ptr-with-value #<hyp 231 (1488 7405) 0.63 [0..8]>) >
The GBBopen Project
linkf |