0

How do I define a eieio class which is a vector of a set of eieio objects?

Specifically, I want the :type property of defclass to effectively say "a vector/list of some other type", and :initform to take a list/vector of some other object.

Is this possible?

To give you an example, think of an HTML-like document which is an ordered collection of (unlimited) paragraph-like objects. I want the HTML-like document to be instance of a document class, which is a collection of p objects ... I am looking for how the defclass declaration for document will look like. (Assume that I have already defined a p class which has a single field of stringtype)

Slot Options (Enhanced Implementation of Emacs Interpreted Objects)

‘:type’
     An unquoted type specifier used to validate data set into this
     slot.  *Note (cl)Type Predicates::.  Here are some examples:
     ‘symbol’
          A symbol.
     ‘number’
          A number type
     ‘my-class-name’
          An object of your class type.
     ‘(or null symbol)’
          A symbol, or ‘nil’.

0 Answers0