diff options
author | Eduardo Julian | 2017-08-03 19:45:26 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-08-03 19:45:26 -0400 |
commit | cb129986c4f97ae947ef582e9a5417db83b28e4c (patch) | |
tree | 0c7f9295d4d74b95e97ed3688c50c82572b229cb /stdlib/test | |
parent | 0c3c53a714019a543e70e0751387b5dfccc3b872 (diff) |
- Implemented Agent-Oriented Programming.
Diffstat (limited to '')
-rw-r--r-- | stdlib/test/test/lux/concurrency/space.lux | 23 | ||||
-rw-r--r-- | stdlib/test/tests.lux | 2 |
2 files changed, 25 insertions, 0 deletions
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] |