Added method to unregister function

This commit is contained in:
Sasha Koshka 2022-08-28 17:36:45 -04:00
parent d48181b832
commit 3b8f87212f
1 changed files with 6 additions and 0 deletions

View File

@ -238,5 +238,11 @@ func (machine *Machine) Register (id int, function MachineFunction) (err error)
return
}
// Unregister removes a function that is registered at the specified ID.
func (machine *Machine) Unregister (id int) {
if machine.functions == nil { return }
delete(machine.functions, id)
}
// Milk milks the stack machine
func (machine *Machine) Milk () {}