Create a two-dimensional array at runtime: Difference between revisions

m
m (mass lang tag)
Line 147:
 
=={{header|Common Lisp}}==
<lang lisp> (let ((d1 (read))
(d2 (read)))
(assert (and (typep d1 '(integer 1))
Line 156:
(p2 (floor d2 2)))
(setf (aref array p1 p2) t)
(print (aref array p1 p2))))</lang>
 
The <tt>[http://www.lispworks.com/documentation/HyperSpec/Body/m_assert.htm assert]</tt> will allow the user to reenter the dimensions if they are not positive integers.