Next: , Previous: make-foreign-array, Up: Functions for creation of grids


4.2.4.5 ensure-foreign-array
— Function: grid:ensure-foreign-array object &optional dimensions element-type initial-element

If object is not a foreign array, make and return a foreign array with the dimensions and element-type. If object is a foreign array, it is returned.

If the first argument to this function is a foreign array, it is returned. If it is not, the foreign array with the desired dimensions, element type, and initial-element is made and returned.
     (grid:ensure-foreign-array nil '(2 2) 'double-float)
     #m((.0000000000000000d0 .0000000000000000d0)
        (.0000000000000000d0 .0000000000000000d0))