July 11, 2011 make-array and its prining in CLisp | ||||
---|---|---|---|---|
| ||||
I find some of the Common Lisp built-ins handy, like: http://ideone.com/Q7qvP This program: (print (make-array '(10 10) :element-type 'bit :initial-element 1)) Shows: #2A(#*1111111111 #*1111111111 #*1111111111 #*1111111111 #*1111111111 #*1111111111 #*1111111111 #*1111111111 #*1111111111 #*1111111111) It's a nD matrix of bits, and you are allowed to give an optional initial element value. make-array is a generic function that works with any type of element. The print shows a nicely formatted array of bits. Bye, bearophile |
Copyright © 1999-2021 by the D Language Foundation