diff options
author | Přemysl Janouch <p@janouch.name> | 2018-10-09 18:16:19 +0200 |
---|---|---|
committer | Přemysl Janouch <p@janouch.name> | 2018-10-09 18:16:19 +0200 |
commit | f7bb33cc3d87fe6636b52bf99c810eb321b1dc42 (patch) | |
tree | 282393bcea965755b5d5c110eb469c3adf8c1f11 | |
parent | f751975cfd967c717473fea400d926a4c9f8beb1 (diff) | |
download | ell-f7bb33cc3d87fe6636b52bf99c810eb321b1dc42.tar.gz ell-f7bb33cc3d87fe6636b52bf99c810eb321b1dc42.tar.xz ell-f7bb33cc3d87fe6636b52bf99c810eb321b1dc42.zip |
Go: remove useless accessors to Ell.Handlers
-rw-r--r-- | ell/ell.go | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -614,16 +614,6 @@ func (ell *Ell) Set(name string, v *V) { scopePrepend(&ell.Globals, name, v) } -// NativeFind returns the handler for a native function or nil. -func (ell *Ell) NativeFind(name string) Handler { - return ell.Native[name] -} - -// NativeRegister registers a native Go function handler. -func (ell *Ell) NativeRegister(name string, handler Handler) { - ell.Native[name] = handler -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Errorf sets an error message in the interpreter context and returns false. @@ -669,7 +659,7 @@ error: } func (ell *Ell) evalNative(name string, args *V, result **V) bool { - fn := ell.NativeFind(name) + fn := ell.Native[name] if fn == nil { return ell.Errorf("unknown function") } @@ -1280,7 +1270,7 @@ set >= { not (< @1 @2) }; set > { < @2 @1 }` // StdInitialize initializes the ell standard library. func StdInitialize(ell *Ell) bool { for name, handler := range stdNative { - ell.NativeRegister(name, handler) + ell.Native[name] = handler } p := NewParser([]byte(stdComposed)) |