From e76e9f5348a678d82875ada7dbe83ff380240429 Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Sat, 5 Jul 2025 14:45:04 -0400 Subject: [PATCH] don't try to export `state`, which no longer exists --- assets/test_prelude.ld | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/assets/test_prelude.ld b/assets/test_prelude.ld index 9a299ae..e37673f 100644 --- a/assets/test_prelude.ld +++ b/assets/test_prelude.ld @@ -1272,6 +1272,11 @@ fn send { } } +fn spawn! { + "Spawns a process. Takes a 0-argument (nullary) function that will be executed as the new process. Returns a keyword process ID (pid) of the newly spawned process." + (f as :fn) -> base :process (:spawn, f) +} + fn yield! { "Forces a process to yield." () -> base :process (:yield) @@ -1323,7 +1328,7 @@ fn fetch { "Requests the contents of the URL passed in. Returns a result tuple of `(:ok, {contents})` or `(:err, {status code})`." (url) -> { let pid = self () - spawn! request_fetch! (pid, url) + spawn! (fn () -> request_fetch! (pid, url)) receive { (:reply, response) -> response } @@ -1348,7 +1353,7 @@ fn read_input { "Waits until there is input in the input buffer, and returns it once there is." () -> { let pid = self () - spawn! input_reader! (pid) + spawn! (fn () -> input_reader! (pid)) receive { (:reply, response) -> response } @@ -1359,7 +1364,7 @@ fn read_input { & completed actor functions self send - & spawn! <- is now a special form + spawn! & <- is no longer a special form yield! sleep! alive? @@ -1524,7 +1529,6 @@ fn read_input { sqrt sqrt/safe square - state store! string string?