feat: 优化print函数,简化参数输出逻辑
This commit is contained in:
@@ -3,10 +3,7 @@
|
|||||||
use crate::interpreter::Value;
|
use crate::interpreter::Value;
|
||||||
|
|
||||||
pub fn print(args: Vec<Value>) -> Value {
|
pub fn print(args: Vec<Value>) -> Value {
|
||||||
for (i, arg) in args.iter().enumerate() {
|
for arg in args.iter() {
|
||||||
if i > 0 {
|
|
||||||
print!(" ");
|
|
||||||
}
|
|
||||||
print!("{}", arg);
|
print!("{}", arg);
|
||||||
}
|
}
|
||||||
println!();
|
println!();
|
||||||
|
|||||||
Reference in New Issue
Block a user