define /MOD in prosper, not as a built-in

This commit is contained in:
David 2021-02-20 19:13:28 -05:00
parent fee9325155
commit 0d322b92df

View File

@ -40,7 +40,7 @@ func main() {
dict.AddWord("*", Word{Name: "*", Impl: b.Mul(&stack)}) dict.AddWord("*", Word{Name: "*", Impl: b.Mul(&stack)})
dict.AddWord("/", Word{Name: "/", Impl: b.Div(&stack)}) dict.AddWord("/", Word{Name: "/", Impl: b.Div(&stack)})
dict.AddWord("MOD", Word{Name: "MOD", Impl: b.Mod(&stack)}) dict.AddWord("MOD", Word{Name: "MOD", Impl: b.Mod(&stack)})
dict.AddWord("/MOD", Word{Name: "/MOD", Impl: b.DivMod(&stack)}) dict.AddWord("/MOD", Word{Name: "/MOD", Source: []string{"2DUP", "MOD", "ROT", "ROT", "/"}})
dict.AddWord("+1", Word{Name: "+1", Source: []string{"1", "+"}}) dict.AddWord("+1", Word{Name: "+1", Source: []string{"1", "+"}})
dict.AddWord("-1", Word{Name: "-1", Source: []string{"1", "-"}}) dict.AddWord("-1", Word{Name: "-1", Source: []string{"1", "-"}})
dict.AddWord("ABS", Word{Name: "ABS", Source: []string{"DUP", "0<", "IF", "NEGATE", "THEN"}}) dict.AddWord("ABS", Word{Name: "ABS", Source: []string{"DUP", "0<", "IF", "NEGATE", "THEN"}})