Handle a signal: Difference between revisions
m
→{{header|TXR}}
(→{{header|TXR}}: Added.) |
m (→{{header|TXR}}) |
||
Line 953:
(throwf 'error "caught signal ~s" signum)))
(let
(catch (each ((num (range
(format t "~s\n" num)
(usleep 500000))
Line 981:
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}}==
|