diff --git a/compiler/cl-interpret/src/builtin.rs b/compiler/cl-interpret/src/builtin.rs index 114142a..a16f2a3 100644 --- a/compiler/cl-interpret/src/builtin.rs +++ b/compiler/cl-interpret/src/builtin.rs @@ -14,6 +14,16 @@ use std::{ builtins! { const MISC; + /// Unstable variadic format function + pub fn format<_, args> () -> IResult { + use std::fmt::Write; + let mut out = String::new(); + for arg in args { + write!(out, "{arg}").ok(); + } + Ok(ConValue::String(out.into())) + } + /// Unstable variadic print function pub fn print<_, args> () -> IResult { let mut out = stdout().lock();