Created
November 5, 2009 19:23
-
-
Save fabjan/227310 to your computer and use it in GitHub Desktop.
This file contains 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 ping | |
(export (start 0) (stop 0) (init 0) (loop 0))) | |
(defun start () | |
(let ((pid (spawn #(ping init ())))) | |
(register 'ping pid))) | |
(defun stop () | |
(! 'ping 'stop)) | |
(defun init () | |
'ok) | |
(defun loop () | |
(receive | |
(('ping from) ((! from 'pong) (loop))) | |
(('stop) 'ok))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment