don't try to export state, which no longer exists

This commit is contained in:
Scott Richmond 2025-07-05 14:45:04 -04:00
parent a38a686a76
commit e76e9f5348

View File

@ -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! { fn yield! {
"Forces a process to yield." "Forces a process to yield."
() -> base :process (: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})`." "Requests the contents of the URL passed in. Returns a result tuple of `(:ok, {contents})` or `(:err, {status code})`."
(url) -> { (url) -> {
let pid = self () let pid = self ()
spawn! request_fetch! (pid, url) spawn! (fn () -> request_fetch! (pid, url))
receive { receive {
(:reply, response) -> response (: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." "Waits until there is input in the input buffer, and returns it once there is."
() -> { () -> {
let pid = self () let pid = self ()
spawn! input_reader! (pid) spawn! (fn () -> input_reader! (pid))
receive { receive {
(:reply, response) -> response (:reply, response) -> response
} }
@ -1359,7 +1364,7 @@ fn read_input {
& completed actor functions & completed actor functions
self self
send send
& spawn! <- is now a special form spawn! & <- is no longer a special form
yield! yield!
sleep! sleep!
alive? alive?
@ -1524,7 +1529,6 @@ fn read_input {
sqrt sqrt
sqrt/safe sqrt/safe
square square
state
store! store!
string string
string? string?