Last active
October 9, 2020 13:52
-
-
Save schmalz/a6c9047048eea2e86d69357fce9bd05c to your computer and use it in GitHub Desktop.
LFE tutorial 18 - processes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmodule lfe-tut-18 | |
(export (start 0) | |
(say-something 2))) | |
(defun say-something | |
([what 0] | |
'done) | |
([what times] | |
(lfe_io:format "~p~n" (list what)) | |
(say-something what (- times 1)))) | |
(defun start [] | |
(spawn 'procs 'say-something '(hello 3)) | |
(spawn 'procs 'say-something '(goodbye 3))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment