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] --- .../library/lux/control/concurrency/actor.lux | 41 +++++++++++----------- .../lux/tool/compiler/language/lux/syntax.lux | 6 ++-- 2 files changed, 23 insertions(+), 24 deletions(-) (limited to 'stdlib/source/library') diff --git a/stdlib/source/library/lux/control/concurrency/actor.lux b/stdlib/source/library/lux/control/concurrency/actor.lux index b1eb1775d..544c672d9 100644 --- a/stdlib/source/library/lux/control/concurrency/actor.lux +++ b/stdlib/source/library/lux/control/concurrency/actor.lux @@ -311,15 +311,14 @@ (<>.and .symbol (at <>.monad in (list))))) (def: messageP - (Parser [Code Signature Code Code]) - (|export|.parser - (all <>.and - ..signature^ - .any - .any))) + (Parser [Signature Code Code]) + (all <>.and + ..signature^ + .any + .any)) -(def: .public message: - (syntax (_ [[export_policy signature output_type body] ..messageP]) +(def: .public message + (syntax (_ [[signature output_type body] ..messageP]) (with_symbols [g!_ g!return] (do meta.monad [actor_scope primitive.current @@ -331,19 +330,19 @@ g!inputsT (|> signature (the #inputs) (list#each product.right)) g!state (|> signature (the #state) code.local) g!self (|> signature (the #self) code.local)]] - (in (list (` (def: (~ export_policy) ((~ g!message) (~+ g!inputsC)) - (All ((~ g!_) (~+ g!all_vars)) - (-> (~+ g!inputsT) - (..Message (~ (the primitive.#abstraction actor_scope)) - (~ output_type)))) - (function ((~ g!_) (~ g!state) (~ g!self)) - (let [(~ g!state) (as (~ (the primitive.#representation actor_scope)) - (~ g!state))] - (|> (~ body) - (is ((~! async.Async) ((~! try.Try) [(~ (the primitive.#representation actor_scope)) - (~ output_type)]))) - (as ((~! async.Async) ((~! try.Try) [(~ (the primitive.#abstraction actor_scope)) - (~ output_type)])))))))) + (in (list (` (is (All ((~ g!_) (~+ g!all_vars)) + (-> (~+ g!inputsT) + (..Message (~ (the primitive.#abstraction actor_scope)) + (~ output_type)))) + (function ((~ g!message) (~+ g!inputsC)) + (function ((~ g!_) (~ g!state) (~ g!self)) + (let [(~ g!state) (as (~ (the primitive.#representation actor_scope)) + (~ g!state))] + (|> (~ body) + (is ((~! async.Async) ((~! try.Try) [(~ (the primitive.#representation actor_scope)) + (~ output_type)]))) + (as ((~! async.Async) ((~! try.Try) [(~ (the primitive.#abstraction actor_scope)) + (~ output_type)]))))))))) )))))) (type: .public Stop diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux b/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux index 6bde519da..eb9402464 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux @@ -499,9 +499,9 @@ {.#Right [source' [@where {@tag full_symbol}]]})])) ... TODO: Grammar macro for specifying syntax. -... (grammar: lux_grammar -... [expression ...] -... [form "(" [#* expression] ")"]) +... (def: lux_grammar +... (grammar [expression "..."] +... [form "(" [#* expression] ")"])) (with_expansions [ (these where (!++ offset/0) source_code) (these [(!forward 1 where) (!++ offset/0) source_code]) -- cgit v1.2.3