don't spam the console

This commit is contained in:
Scott Richmond 2025-07-09 15:15:12 -04:00
parent 6c663f598f
commit 044d7e6dd0
3 changed files with 19 additions and 19 deletions

View File

@ -112,7 +112,7 @@ pub fn chars(x: &Value) -> Value {
}
pub fn words(str: &Value) -> Value {
console_log!("wordsing words");
// console_log!("wordsing words");
let str = Value::as_string(str);
let mut words = Vector::new();
let mut word = String::new();
@ -124,7 +124,7 @@ pub fn words(str: &Value) -> Value {
word = String::new()
}
}
console_log!("words gathered into vector; returning to ludus");
// console_log!("words gathered into vector; returning to ludus");
Value::list(words)
}

View File

@ -95,7 +95,7 @@ pub async fn do_io (msgs: Vec<MsgOut>) -> Vec<MsgIn> {
if !inbox.is_empty() {
// console_log!("ludus received messages");
for msg in inbox.iter() {
console_log!("{}", msg);
// console_log!("{}", msg);
}
}
inbox

View File

@ -256,7 +256,7 @@ impl Creature {
}
fn broadcast_panic(&mut self) {
console_log!("broadcasting panic in {}", self.pid);
// console_log!("broadcasting panic in {}", self.pid);
let Err(panic) = self.result.clone().unwrap() else {
unreachable!("expected panic in broadcast panic");
};
@ -369,7 +369,7 @@ impl Creature {
}
"yield" => {
self.r#yield = true;
console_log!("yielding from {}", self.pid);
// console_log!("yielding from {}", self.pid);
self.push(Value::Keyword("ok"));
}
"alive" => {
@ -389,19 +389,19 @@ impl Creature {
"flush" => {
let msgs = self.mbx.iter().cloned().collect::<Vec<_>>();
let msgs = Vector::from(msgs);
console_log!(
"delivering messages: {}",
msgs.iter()
.map(|x| x.show())
.collect::<Vec<_>>()
.join(" | ")
);
// console_log!(
// "delivering messages: {}",
// msgs.iter()
// .map(|x| x.show())
// .collect::<Vec<_>>()
// .join(" | ")
// );
self.mbx = VecDeque::new();
console_log!("flushing messages in {}", self.pid);
// console_log!("flushing messages in {}", self.pid);
self.push(Value::List(Box::new(msgs)));
}
"sleep" => {
console_log!("sleeping {} for {}", self.pid, args[1]);
// console_log!("sleeping {} for {}", self.pid, args[1]);
let Value::Number(ms) = args[1] else {
unreachable!()
};
@ -584,7 +584,7 @@ impl Creature {
PanicNoLetMatch => {
if !self.matches {
self.ip -= 2;
console_log!("panic at bytecode {}", self.ip);
// console_log!("panic at bytecode {}", self.ip);
return self.panic(PanicMsg::NoLetMatch);
}
}
@ -793,10 +793,10 @@ impl Creature {
let dict = match self.get_value_at(dict_idx) {
Value::Dict(dict) => dict,
value => {
console_log!(
"internal Ludus error in function {}",
self.frame.function.as_fn().name()
);
// console_log!(
// "internal Ludus error in function {}",
// self.frame.function.as_fn().name()
// );
unreachable!("expected dict, got {value}")
}
};