可嵌入、具执行预算的 Forth 子集
///|
test "extended standard stack words" {
let m = @forth.Machine::new()
m.eval("1 2 2dup 2swap 2drop nip")
assert_eq(m.values(), [2])
let t = @forth.Machine::new()
t.eval("1 2 tuck")
assert_eq(t.values(), [2, 1, 2])
assert_true(
try {
let x = @forth.Machine::new()
x.eval("2dup")
false
} catch {
_ => true
},
)
}Install
Download zip可嵌入、具执行预算的 Forth 子集