• Top
  • Sint-array

Make-sint-array

Basic constructor macro for sint-array structures.

Syntax
(make-sint-array [:elemtype <elemtype>] 
                 [:elements <elements>]) 

This is the usual way to construct sint-array structures. It simply conses together a structure with the specified fields.

This macro generates a new sint-array structure from scratch. See also change-sint-array, which can "change" an existing structure, instead.

Definition

This is an ordinary make- macro introduced by fty::defprod.

Macro: make-sint-array

(defmacro make-sint-array (&rest args)
  (std::make-aggregate 'sint-array
                       args '((:elemtype) (:elements))
                       'make-sint-array
                       nil))

Function: sint-array

(defun sint-array (elemtype elements)
  (declare (xargs :guard (and (typep elemtype)
                              (sint-listp elements))))
  (declare (xargs :guard (and (type-case elemtype :sint)
                              (consp elements))))
  (let ((__function__ 'sint-array))
    (declare (ignorable __function__))
    (b* ((elemtype (mbe :logic (type-fix elemtype)
                        :exec elemtype))
         (elements (mbe :logic (sint-list-fix elements)
                        :exec elements)))
      (let ((elemtype (mbe :logic
                           (if (type-case elemtype :sint)
                               elemtype
                             (type-sint))
                           :exec elemtype))
            (elements (mbe :logic
                           (if (consp elements)
                               elements
                             (list (sint-from-integer 0)))
                           :exec elements)))
        (cons :array (list elemtype elements))))))