Fork: Difference between revisions

Content added Content deleted
(→‎Common Lisp: formatting, plusp)
Line 84: Line 84:
<lang lisp>(let ((pid (sb-posix:fork)))
<lang lisp>(let ((pid (sb-posix:fork)))
(cond
(cond
((zerop pid)
((zerop pid) (write-line "This is the new process."))
(write-line "This is the new process."))
((plusp pid) (write-line "This is the original process."))
(t (error "Something went wrong while forking."))))</lang>
((> pid 0)
(write-line "This is the original process."))
(t
(error "Something went wrong while forking."))))</lang>


=={{header|Erlang}}==
=={{header|Erlang}}==