On Thu, 15 Sep 2016, David Pirotte wrote:

Hi Jan,

Thanks a lot for the work. I am trying to run my project "aiscm" with it.
   I noticed that slots are now objects themselves. So instead of (car <>),
one can use (slot-ref <> 'name). Please let me know if there is a better
way to get the slot names of a class.

     (use-modules (oop goops))
     (define-class <values> ()
       (a #:init-keyword #:a))

     (car (car (class-slots (class-of (make <values> #:a 1))))); Guile 2.0
     (slot-ref (car (class-slots (class-of (make <values> #:a 1)))) 'name); 
Guile
2.1.4

        slot-definition-name

See the '8.8 Introspection' section in the manual

David


Thanks, that works with both versions of Guile :)

Reply via email to