From cb129986c4f97ae947ef582e9a5417db83b28e4c Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 3 Aug 2017 19:45:26 -0400 Subject: - Implemented Agent-Oriented Programming. --- stdlib/test/test/lux/concurrency/space.lux | 23 +++++++++++++++++++++++ stdlib/test/tests.lux | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 stdlib/test/test/lux/concurrency/space.lux (limited to 'stdlib/test') diff --git a/stdlib/test/test/lux/concurrency/space.lux b/stdlib/test/test/lux/concurrency/space.lux new file mode 100644 index 000000000..d99733958 --- /dev/null +++ b/stdlib/test/test/lux/concurrency/space.lux @@ -0,0 +1,23 @@ +(;module: + lux + (lux (control [monad #+ do]) + (concurrency ["T" task] + ["A" actor #+ actor:] + ["S" space #+ on:]) + [io])) + +(type: Move + #Ping + #Pong) + +(A;actor: #export Player {} + {#hits Nat}) + +(on: Player Move (reply! who where what state self) + (do @ + [_ (S;emit (case what + #Ping #Pong + #Pong #Ping) + where + self)] + (wrap (update@ #hits n.inc state)))) diff --git a/stdlib/test/tests.lux b/stdlib/test/tests.lux index 39ac02d5e..2f1da760f 100644 --- a/stdlib/test/tests.lux +++ b/stdlib/test/tests.lux @@ -13,6 +13,7 @@ ["_;" duration] ["_;" date]) (concurrency ["_;" actor] + ["_;" space] ["_;" atom] ["_;" frp] ["_;" promise] @@ -71,6 +72,7 @@ )) (lux (control [contract] [concatenative]) + (concurrency [space]) (data [env] [trace] [store] -- cgit v1.2.3