From f7bb33cc3d87fe6636b52bf99c810eb321b1dc42 Mon Sep 17 00:00:00 2001 From: Přemysl Janouch
Date: Tue, 9 Oct 2018 18:16:19 +0200 Subject: Go: remove useless accessors to Ell.Handlers --- ell/ell.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/ell/ell.go b/ell/ell.go index fec359f..8ed371e 100644 --- a/ell/ell.go +++ b/ell/ell.go @@ -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)) -- cgit v1.2.3-70-g09d2