Lines in an extern.C { … } block may each say pub: here strlen is public and write stays private behind a safe wrapper, as good practice #5 says.
extern_block_pub.zg
# Lines in an `extern.C { … }` block may each say `pub` (owner, 2026-10-02: "allow mixing, but block# overrides"): here `strlen` is public and `write` stays private behind a safe wrapper, as good# practice #5 says. A `pub` before the block would make every line public.bare.never[fn];moduletext{extern.C{pubfnstrlen['s':ptr[uint8]]->uint64;fnwrite['fd':int32,'buf':ptr[uint8],'len':uint64]->int64;}pubfnsay[lent'msg':str.utf8]{no_checklet'n':=write[1,lend'msg',str.bytes[lend'msg']];}}MAIN{let'word':="hello";no_checklet'n':=text.strlen[lend'word'];std::print.useful["strlen: ",'n',newln];let'line':="written by the wrapper"++newln;text.say[lend'line'];}