diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/documentation/lux/control/concurrency/actor.lux | 56 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/type/implicit.lux | 6 |
2 files changed, 5 insertions, 57 deletions
diff --git a/stdlib/source/documentation/lux/control/concurrency/actor.lux b/stdlib/source/documentation/lux/control/concurrency/actor.lux index fb84a5b1f..1ad895a87 100644 --- a/stdlib/source/documentation/lux/control/concurrency/actor.lux +++ b/stdlib/source/documentation/lux/control/concurrency/actor.lux @@ -19,8 +19,8 @@ (documentation: (/.Obituary state) "Details on the death of an actor.") -(documentation: (/.Behavior input state) - "An actor's behavior when mail is received and when a fatal error occurs.") +(documentation: (/.Behavior state) + "An actor's behavior when mail is received.") (documentation: /.spawn! "Given a behavior and initial state, spawns an actor and returns it.") @@ -44,55 +44,6 @@ (format "Kills the actor by sending mail that will kill it upon processing," \n "but allows the actor to handle previous mail.")) -(with_expansions [<examples> (these (actor: .public (stack a) - (List a) - - ((on_mail mail state self) - (do (try.with async.monad) - [.let [_ (debug.log! "BEFORE")] - output (mail state self) - .let [_ (debug.log! "AFTER")]] - (in output))) - - (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 - - (def: .public count! - (message .public (_ [increment Nat] state self) - Any - (let [state' (n.+ increment state)] - (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.") - [<examples>]) - - (documentation: /.actor - (format "Defines an anonymous actor, with its behavior and internal state." - \n "Messages for the actor must be defined after the on_mail handler.") - [(actor [Nat - 123] - ((on_mail message state self) - (message (++ state) self)))]) - - (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." - \n "A message may succeed or fail (in case of failure, the actor dies).") - [<examples>])) - (documentation: /.Stop "A signal to stop an actor from observing a channel.") @@ -116,9 +67,6 @@ ..tell! ..default ..poison! - ..actor: - ..actor - ..message ..Stop ..observe! ($.default /.poisoned) diff --git a/stdlib/source/documentation/lux/type/implicit.lux b/stdlib/source/documentation/lux/type/implicit.lux index be1b19999..6a54a0dae 100644 --- a/stdlib/source/documentation/lux/type/implicit.lux +++ b/stdlib/source/documentation/lux/type/implicit.lux @@ -43,9 +43,9 @@ (n.= (at n.addition composite left right) (a/an composite left right)))]) -(documentation: /.implicit: +(documentation: /.implicitly "Establish local definitions for implementations that will be prioritized over foreign definitions." - [(implicit: [n.multiplication]) + [(implicitly n.multiplication) (n.= (at n.multiplication composite left right) (a/an composite left right))]) @@ -56,5 +56,5 @@ "" [..a/an ..with - ..implicit:] + ..implicitly] [])) |