Handle a signal: Difference between revisions

Content added Content deleted
Line 953: Line 953:
(throwf 'error "caught signal ~s" signum)))
(throwf 'error "caught signal ~s" signum)))


(let* ((start-time (time)))
(let ((start-time (time)))
(catch (each ((num (range* 1)))
(catch (each ((num (range 1)))
(format t "~s\n" num)
(format t "~s\n" num)
(usleep 500000))
(usleep 500000))
Line 981: Line 981:


caught signal 2 after 6 seconds of execution</pre>
caught signal 2 after 6 seconds of execution</pre>

<code>range</code> generates a range of integers as a lazy list, which is infinite if the endpoint argument is omitted. We walk this infinite list using <code>each</code> like any other list.


=={{header|UNIX Shell}}==
=={{header|UNIX Shell}}==