Programming-Idioms

History of Idiom 43 > diff from v41 to v42

Edit summary for version 42 :
New Lisp implementation by user [foobar]

Version 41

2019-09-26, 15:35:03

Version 42

2019-09-26, 16:18:12

Idiom #43 Break outer loop

Look for a negative value v in 2D integer matrix m. Print it and stop searching.

Illustration

Idiom #43 Break outer loop

Look for a negative value v in 2D integer matrix m. Print it and stop searching.

Illustration
Code
(loop named outer
      for i below (array-dimension m 0)
      do (loop for j below (array-dimension m 1)
               for v = (aref m i j)
               when (minusp v)
               do (progn
                    (print v)
                    (return-from outer))))