Skip to content
  • Andy Wingo's avatar
    Generics with setters have <applicable-struct-with-setter> layout · 6c7dd9eb
    Andy Wingo authored
    * libguile/goops.c (scm_sys_set_object_setter_x): Remove.  Instead, we
      use slot-set! of 'setter.
      (scm_i_define_class_for_vtable): Move lower in the file, and fold in
      scm_make_extended_class_from_symbol and make_class_from_symbol.
      Properly handle applicable structs with setters.
      (scm_class_applicable_struct_with_setter_class): New private capture.
      (scm_sys_bless_applicable_struct_vtables_x): Rename to take two
      arguments, and bless the second argument as an applicable struct with
      setter vtable.
      (scm_sys_goops_early_init): Capture setter classes.
    
    * libguile/deprecated.c (SPEC_OF, CPL_OF): Access slots by name, not by
      index.
      (applicablep, more_specificp): Adapt to use CPL_OF.
      (scm_find_method): Access "methods" slot by name.
    
    * libguile/procs.c (scm_setter): Remove special case for generics; if
      it's a setter, it will be a normal applicable struct.
    * module/oop/goops.scm (<applicable-struct-with-setter-class>)
      (<applicable-struct-with-setter>): New classes.
      (<generic-with-setter>): Now an instance of the setter metaclass and a
      child of the setter class, so that the "setter" slot ends up in the
      right place.
      (<accessor>, <extended-generic-with-setter>, <extended-accessor>): Be
      instances of the setter metaclass.
      (<method>, <accessor-method>): Move definitions farther down.
      (make): Use slot-set! when initializing setters here.
      (initialize): Likewise for <applicable-struct-with-setter>.  Remove
      specialization for <generic-with-setter>.
    6c7dd9eb