From 94c0bc5d12ed44540543bd6772d357baeb32bb45 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 12 Jun 2022 18:28:30 -0400 Subject: De-sigil-ification: suffix : [Part 5] --- .../lux/control/concurrency/actor.lux | 29 ++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'stdlib/source/documentation') 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) -- cgit v1.2.3