Compare commits
No commits in common. "808368d2b97e2ce709b56fb223c7351e6a056997" and "1ec60b9362f53e9bf5e0eeda8a7ae0b7322c5506" have entirely different histories.
808368d2b9
...
1ec60b9362
|
@ -1,7 +1,6 @@
|
||||||
if (window) window.ludus = {run, kill, flush_stdout, stdout, p5, svg, flush_commands, commands, result, input, is_running}
|
if (window) window.ludus = {run, kill, flush_stdout, stdout, p5, svg, flush_commands, commands, result, input, is_running}
|
||||||
|
|
||||||
const worker_url = new URL("worker.js", import.meta.url)
|
const worker = new Worker("worker.js", {type: "module"})
|
||||||
const worker = new Worker(worker_url, {type: "module"})
|
|
||||||
|
|
||||||
let outbox = []
|
let outbox = []
|
||||||
let ludus_console = ""
|
let ludus_console = ""
|
||||||
|
|
35
sandbox.ld
35
sandbox.ld
|
@ -1,34 +1 @@
|
||||||
fn inputter () -> {
|
:foobar
|
||||||
if do input > unbox > empty?
|
|
||||||
then {
|
|
||||||
yield! ()
|
|
||||||
inputter ()
|
|
||||||
}
|
|
||||||
else receive {
|
|
||||||
(:get, pid) -> send (pid, (:reply, unbox (input)))
|
|
||||||
(:flush, pid) -> {
|
|
||||||
send (pid, (:reply, unbox (input)))
|
|
||||||
store! (input, "")
|
|
||||||
}
|
|
||||||
(:clear) -> store! (input, "")
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
fn clear_input () -> store! (input, "")
|
|
||||||
|
|
||||||
fn read_input () -> {
|
|
||||||
let reader = spawn! (inputter)
|
|
||||||
send (reader, (:get, self ()))
|
|
||||||
receive {
|
|
||||||
(:reply, msg) -> msg
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn flush_input () -> {
|
|
||||||
let reader = spawn! (inputter)
|
|
||||||
send (reader, (:flush, self ()))
|
|
||||||
receive {
|
|
||||||
(:reply, msg) -> msg
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user