db9025f3a3
- C runtime: bux_float_to_string() for float64 → String conversion
- String.bux: add String_FromFloat, extern decl for bux_float_to_string
- library/std/Fmt.bux: Fmt_Fmt1, Fmt_Fmt2, Fmt_Fmt3, Fmt_FmtInt, Fmt_FmtInt2,
Fmt_FmtFloat, Fmt_FmtBool — positional {0}, {1}, {2} placeholders
- Refactor examples to use Fmt:
factorial.bux, fibonacci.bux, process.bux, os_time.bux
17 lines
470 B
Plaintext
17 lines
470 B
Plaintext
// Process - Run external commands and capture output
|
|
import Std::Io::{PrintLine};
|
|
import Std::Process::{Process_Run, Process_Output};
|
|
import Std::Fmt::{Fmt_Fmt1, Fmt_FmtInt};
|
|
|
|
func Main() -> int {
|
|
PrintLine("Process demo:");
|
|
|
|
let output: String = Process_Output("echo Hello from subprocess");
|
|
PrintLine(Fmt_Fmt1("Captured: {0}", output));
|
|
|
|
let rc: int = Process_Run("true");
|
|
PrintLine(Fmt_FmtInt("Exit code: {0}", rc));
|
|
|
|
return 0;
|
|
}
|