aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/documentation')
-rw-r--r--stdlib/source/documentation/lux/control/concurrency/actor.lux29
1 files changed, 16 insertions, 13 deletions
diff --git a/stdlib/source/documentation/lux/control/concurrency/actor.lux b/stdlib/source/documentation/lux/control/concurrency/actor.lux
index 174ff4718..fb84a5b1f 100644
--- a/stdlib/source/documentation/lux/control/concurrency/actor.lux
+++ b/stdlib/source/documentation/lux/control/concurrency/actor.lux
@@ -54,22 +54,25 @@
.let [_ (debug.log! "AFTER")]]
(in output)))
- (message: .public (push [value a] state self)
- (List a)
- (let [state' {.#Item value state}]
- (async.resolved {try.#Success [state' state']}))))
+ (def: .public push
+ (message (_ [value a] state self)
+ (List a)
+ (let [state' {.#Item value state}]
+ (async.resolved {try.#Success [state' state']})))))
(actor: .public counter
Nat
- (message: .public (count! [increment Nat] state self)
- Any
- (let [state' (n.+ increment state)]
- (async.resolved {try.#Success [state' state']})))
+ (def: .public count!
+ (message .public (_ [increment Nat] state self)
+ Any
+ (let [state' (n.+ increment state)]
+ (async.resolved {try.#Success [state' state']}))))
- (message: .public (read! state self)
- Nat
- (async.resolved {try.#Success [state state]}))))]
+ (def: .public read!
+ (message (_ state self)
+ Nat
+ (async.resolved {try.#Success [state state]})))))]
(documentation: /.actor:
(format "Defines a named actor, with its behavior and internal state."
\n "Messages for the actor must be defined after the on_mail handler.")
@@ -83,7 +86,7 @@
((on_mail message state self)
(message (++ state) self)))])
- (documentation: /.message:
+ (documentation: /.message
(format "A message can access the actor's state through the state parameter."
\n "A message can also access the actor itself through the self parameter."
\n "A message's output must be an async containing a 2-tuple with the updated state and a return value."
@@ -115,7 +118,7 @@
..poison!
..actor:
..actor
- ..message:
+ ..message
..Stop
..observe!
($.default /.poisoned)