Next / Previous / Contents / Shipman's homepage

5.15. ibp-field-def: Field definition object

The ibp-field-def represents the definition of one field in the record tail.

The “constructor” for a field definition object has this syntax:

(ibp-field-def len filler)

where len is the field's length in characters, and filler is the default content.

The accessor functions are:

(ibp-field-def-len F)

Returns the field's length.

(ibp-field-filler F)

Returns the field's default content.

Here is the constructor. It takes the two arguments and assembles them into an emacs vector object (basically a linear array) with the vector function.

ibp.el
;; - - - - -   c l a s s   i b p - f i e l d - d e f

(defun ibp-field-def (len filler)
  "Constructor for a ibp-field-def, representing one field definition

    [ if (len is the length of a field as a positive integer)
      and (filler is the default content of the field, or nil if
      its default content is blank) ->
        return a ibp-field-def representing those values ]
  "
  (vector len filler))

There are two accessor functions. They access the attributes of the object by position: the len attribute is at position 0, and the filler attribute is at position 1. The elt function is a built-in function that takes two arguments, a sequence and a position, and returns the element of that sequence at that position.

ibp.el
(defun ibp-field-def-len    (field-def) (elt field-def 0))
(defun ibp-field-def-filler (field-def) (elt field-def 1))