This is my class's package:
(in-package :cl-user)
(defpackage foo
(:use :cl)
(:export :bar))
(in-package :foo)
(defclass bar ()
(baz))
I can create an instance of bar
in package cl-user
.
CL-USER> (defvar f)
F
CL-USER> (setf f (make-instance 'foo:bar))
#<FOO:BAR {10044340C3}>
But I can't access the member baz
. Calling slot-value
like so ...
CL-USER> (slot-value f 'baz)
... results in this error message:
When attempting to read the slot's value (slot-value), the slot
BAZ is missing from the object #<FOO:BAR {10044340C3}>.
[Condition of type SIMPLE-ERROR]
I already tried to add baz
to the :export
list but that does not work either.
How to export slots and accessors from packages?