https://github.com/akkartik/mu/blob/main/shell/print.mu
1 fn print-cell _in: (addr handle cell), out: (addr stream byte), trace: (addr trace) {
2 check-stack
3 trace-text trace, "print", "print"
4 trace-lower trace
5 var in/eax: (addr handle cell) <- copy _in
6 var in-addr/eax: (addr cell) <- lookup *in
7 {
8 compare in-addr, 0
9 break-if-!=
10 write out, "NULL"
11 trace-higher trace
12 return
13 }
14 {
15 var nil?/eax: boolean <- nil? in-addr
16 compare nil?, 0/false
17 break-if-=
18 write out, "()"
19 trace-higher trace
20 return
21 }
22 var in-type/ecx: (addr int) <- get in-addr, type assume-resources [
# contents for a local file
[/foo/bar] <- [
|def| # lines delimited by '|'
]
# contents for a URL
[example.com/foo/bar] <- [
|abc|
]
]