From 0beb121f325a8e2e0473496f4ed93e620def95b1 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 9 Jul 2024 06:13:05 -0500 Subject: [PATCH] cl-interpret: Change print to print without newline, add new println builtin --- compiler/cl-interpret/src/builtin.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compiler/cl-interpret/src/builtin.rs b/compiler/cl-interpret/src/builtin.rs index 2b8fded..702dd40 100644 --- a/compiler/cl-interpret/src/builtin.rs +++ b/compiler/cl-interpret/src/builtin.rs @@ -16,6 +16,14 @@ builtins! { const MISC; /// Unstable variadic print function pub fn print<_, args> () -> IResult { + let mut out = stdout().lock(); + for arg in args { + write!(out, "{arg}").ok(); + } + Ok(ConValue::Empty) + } + /// Unstable variadic println function + pub fn println<_, args> () -> IResult { let mut out = stdout().lock(); for arg in args { write!(out, "{arg}").ok();