From 43f466a74e5a66a16b93860d8d8183e5c35ebd09 Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Mon, 7 Jul 2025 08:42:09 -0400 Subject: [PATCH] fix prelude bindings --- assets/prelude.ld | 20 ++++++++++---------- pkg/rudus_bg.wasm | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/assets/prelude.ld b/assets/prelude.ld index ee98016..3a2e60d 100644 --- a/assets/prelude.ld +++ b/assets/prelude.ld @@ -1137,7 +1137,7 @@ fn heed { fn send_sync { "Sends the message to the specified process, and waits for a response in the form of a `(:reply, response)` tuple." (pid, msg) -> { - send (pid, msg) + send! (pid, msg) receive { (:reply, res) -> res } @@ -1157,7 +1157,7 @@ fn request_fetch! { request_fetch! (pid) } else { - send (pid, (:reply, unbox (fetch_inbox))) + send! (pid, (:reply, unbox (fetch_inbox))) store! (fetch_inbox, ()) } } @@ -1167,7 +1167,7 @@ fn fetch { "Requests the contents of the URL passed in. Returns a result tuple of (:ok, ) or (:err, )." (url) -> { let pid = self () - spawn! (fn () -> request_fetch! (pid, url)) + spawn (fn () -> request_fetch! (pid, url)) receive { (:reply, (_, response)) -> response } @@ -1182,7 +1182,7 @@ fn input_reader! { input_reader! (pid) } else { - send (pid, (:reply, unbox (input))) + send! (pid, (:reply, unbox (input))) store! (input, nil) } } @@ -1192,7 +1192,7 @@ fn read_input { "Waits until there is input in the input buffer, and returns it once there is." () -> { let pid = self () - spawn! (fn () -> input_reader! (pid)) + spawn (fn () -> input_reader! (pid)) receive { (:reply, response) -> response } @@ -1390,10 +1390,10 @@ fn turtle_listener () -> { add_command! (self (), (:loadstate, position, heading, visible?, pendown?, penwidth, pencolor)) } - (:pencolor, pid) -> send (pid, (:reply, do turtle_states > unbox > self () > :pencolor)) - (:position, pid) -> send (pid, (:reply, do turtle_states > unbox > self () > :position)) - (:penwidth, pid) -> send (pid, (:reply, do turtle_states > unbox > self () > :penwidth)) - (:heading, pid) -> send (pid, (:reply, do turtle_states > unbox > self () > :heading)) + (:pencolor, pid) -> send! (pid, (:reply, do turtle_states > unbox > self () > :pencolor)) + (:position, pid) -> send! (pid, (:reply, do turtle_states > unbox > self () > :position)) + (:penwidth, pid) -> send! (pid, (:reply, do turtle_states > unbox > self () > :penwidth)) + (:heading, pid) -> send! (pid, (:reply, do turtle_states > unbox > self () > :heading)) does_not_understand -> { let pid = self () panic! "{pid} does not understand message: {does_not_understand}" @@ -1405,7 +1405,7 @@ fn turtle_listener () -> { fn spawn_turtle { "Spawns a new turtle in a new process. Methods on the turtle process mirror those of turtle graphics functions in prelude. Returns the pid of the new turtle." () -> { - let pid = spawn! (fn () -> turtle_listener ()) + let pid = spawn (fn () -> turtle_listener ()) update! (turtle_states, assoc (_, pid, turtle_init)) pid } diff --git a/pkg/rudus_bg.wasm b/pkg/rudus_bg.wasm index b13c386..c323027 100644 --- a/pkg/rudus_bg.wasm +++ b/pkg/rudus_bg.wasm @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:099016b50e0d690d687a658079c07714378d84c0a07f30712ae6aba2f2814121 +oid sha256:52bfc631de8b277be58144ccb68417236ba63d7fdebdf4af24eed639404ca721 size 16798859