Loop word

This commit is contained in:
2026-01-24 12:47:19 +01:00
parent 6f5fa762a4
commit b1a982aaa0
3 changed files with 16 additions and 0 deletions

View File

@@ -647,6 +647,13 @@ impl Forth {
}
}
Op::Loop => {
let beats = stack.pop().ok_or("stack underflow")?.as_float()?;
let dur = beats * 60.0 / ctx.tempo / ctx.speed;
cmd.set_param("fit".into(), dur.to_string());
cmd.set_param("dur".into(), dur.to_string());
}
Op::ListStart => {
stack.push(Value::Marker);
}