Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type Stack = Vec<i32>;
- type NativeWord = fn(&mut Stack);
- enum ForthWord<'a> {
- NativeWord(NativeWord),
- CompiledWord(&'a [ForthWord<'a>])
- }
- fn plus(stack: &mut Stack) {
- let a = stack.pop().unwrap();
- let b = stack.pop().unwrap();
- stack.push(a + b)
- }
- fn push1(stack: &mut Stack) {
- stack.push(1)
- }
- fn main() {
- let push1_word =
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement