file io
This commit is contained in:
@@ -9,18 +9,15 @@ odin build . -out:build/brolang
|
||||
./build/prototype
|
||||
```
|
||||
|
||||
Programs may receive the system I/O capability explicitly. Readers and writers
|
||||
pair that implementation with a stream; `main func() ...` remains valid.
|
||||
Programs may receive the system I/O capability explicitly. Standard-stream
|
||||
helpers bind the provider, handle, and callback; `main func() ...` remains valid.
|
||||
|
||||
```bro
|
||||
io :: import "@std/io"
|
||||
process :: import "@std/process"
|
||||
|
||||
main func(init process.Init) void {
|
||||
io.print(io.Writer {
|
||||
impl = init.io,
|
||||
stream = .stdout,
|
||||
}, "hello {s} {d}\n", {"bro", 37}) catch |_| {
|
||||
io.print(io.stdout(init.io), "hello {s} {d}\n", {"bro", 37}) catch |_| {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user