Skip to content

Instantly share code, notes, and snippets.

@schmalz
Last active October 9, 2020 13:52
Show Gist options
  • Save schmalz/a6c9047048eea2e86d69357fce9bd05c to your computer and use it in GitHub Desktop.
Save schmalz/a6c9047048eea2e86d69357fce9bd05c to your computer and use it in GitHub Desktop.
LFE tutorial 18 - processes
(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