add DO LOOP

This commit is contained in:
2021-02-14 20:26:30 -05:00
parent 626e90d54c
commit 9d3f61338f
5 changed files with 149 additions and 62 deletions

View File

@@ -7,17 +7,19 @@ type Dictionary map[string]Word
// A Word defines a subroutine
type Word struct {
Name string
Impl func() error
Source []string
Name string
Impl func() error
Source []string
Immediate bool
}
// AddWord inserts a new word into the dictonary, optionally overwriting the existing word
func (d Dictionary) AddWord(name string, impl func() error, source []string) {
func (d Dictionary) AddWord(name string, impl func() error, source []string, immediate bool) {
d[name] = Word{
Name: name,
Impl: impl,
Source: source,
Name: name,
Impl: impl,
Source: source,
Immediate: immediate,
}
}