From 3a237c3a4ff59c90688a0f5bb7cdfef5cdd79d65 Mon Sep 17 00:00:00 2001 From: Qi Xiao Date: Tue, 23 Feb 2016 00:10:00 +0100 Subject: [PATCH] Temporarily fix the builtin namespace. --- eval/eval.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eval/eval.go b/eval/eval.go index 32cfc8fc..971c4fdf 100644 --- a/eval/eval.go +++ b/eval/eval.go @@ -72,7 +72,13 @@ func NewEvaler(st *store.Store) *Evaler { builtin[FnPrefix+b.Name] = NewRoVariable(b) } - return &Evaler{builtin, Namespace{}, map[string]Namespace{}, st, nil, nil} + // XXX Temporary fix for compiler not knowing builtin namespace. + global := Namespace{} + for k, v := range builtin { + global[k] = v + } + + return &Evaler{builtin, global, map[string]Namespace{}, st, nil, nil} } func (e *Evaler) searchPaths() []string {