[plt-scheme] Organizing Code, Pt.2
> (module module-a
> (lib "swindle.ss" "swindle")
>
> (defclass test-parent()
> (name :accessor name :initarg :name))
>
> (provide test-parent))
>
> Requiring this module allows me to create instances of the class but
> inspecting these instances fail:
>
> => (require (lib "swindle.ss" "swindle"))
> => (require "module-a.scm")
> => (define tp (make test-parent :name "Parent"))
> => (display-object tp)
> #<test-parent:Parent>=> (name tp)
> reference to undefined identifier: name
Hi Kevin,
I'm not too familiar with CLOS yet, but does SLOT-REF do what you want?
;;;;;;
> (slot-ref (make test-parent :name "Parent") 'name)
"Parent"
;;;;;;
Best of wishes!