diff --git a/bootstrap/pkg/core/core.go b/bootstrap/pkg/core/core.go index 0344f30..d9991e0 100644 --- a/bootstrap/pkg/core/core.go +++ b/bootstrap/pkg/core/core.go @@ -21,6 +21,8 @@ package core import ( "fmt" + "os" + "path/filepath" "github.com/chzyer/readline" ) @@ -53,12 +55,19 @@ Replace the readline implementation with go-prompt. func REPL(debug bool) { rt := MakeRuntime(debug) - rt.CreateNS("user", "REPL", true) - rl, err := readline.New("> ") + + rl, err := readline.NewEx(&readline.Config{ + Prompt: "> ", + HistoryFile: filepath.Join(os.Getenv("HOME"), ".serene.history"), + InterruptPrompt: "^C", + EOFPrompt: "exit", + HistorySearchFold: true, + }) if err != nil { panic(err) } + rl.HistoryEnable() defer rl.Close() fmt.Println(`Serene's bootstrap interpreter is used to diff --git a/bootstrap/pkg/core/eval.go b/bootstrap/pkg/core/eval.go index fed1cff..02269e8 100644 --- a/bootstrap/pkg/core/eval.go +++ b/bootstrap/pkg/core/eval.go @@ -136,7 +136,6 @@ tco: break tco //return } - fmt.Printf("<<< %s\n", list) f := exprs.(*List).First() switch f.GetType() {