lead_std/io.rs
1use interpreter::{
2 types::{BufValue, MethodRes},
3 Package,
4};
5
6pub struct IO;
7impl Package for IO {
8 fn name(&self) -> &'static str {
9 "📦 Lead Programming Language / IO"
10 }
11
12 fn methods(&self) -> MethodRes {
13 &[(":print", |args, heap, _| {
14 let args = &args[1..];
15 let args = args
16 .iter()
17 .map(|x| match heap.get(x) {
18 Some(x) => format!("{:?}", x),
19 _ => format!("NONE"),
20 })
21 .collect::<Vec<_>>();
22
23 println!("{:#?}", &args);
24 })]
25 }
26}