use r_derive::*;
use std::io::Write;
use crate::callable::core::*;
use crate::formals;
use crate::lang::*;
use crate::object::*;
#[doc(alias = "print")]
#[builtin(sym = "print")]
#[derive(Debug, Clone, PartialEq)]
pub struct PrimitivePrint;
formals!(PrimitivePrint, "(x, ...)");
impl Callable for PrimitivePrint {
fn call_matched(&self, args: List, _ellipsis: List, stack: &mut CallStack) -> EvalResult {
let mut args = Obj::List(args);
let x = args.try_get_named("x")?.force(stack)?;
writeln!(stack.session.output, "{x}").ok();
Ok(x)
}
}