From 47f28a0151397541a25a23fe2005efdcef75d9d0 Mon Sep 17 00:00:00 2001 From: Massimiliano Ghilardi Date: Thu, 29 Jun 2017 21:43:55 +0200 Subject: [PATCH] switched to fast interpreter by default. to use classic interpreter, type :classic at REPL --- example/arith.gomacro | 2 -- example/collatz.gomacro | 2 -- example/collatz.igo | 0 example/embedded_field.gomacro | 4 ++-- example/fibonacci.gomacro | 2 -- example/make_fibonacci.gomacro | 0 fast/func1ret1.go | 10 ---------- main.go | 5 ++++- 8 files changed, 6 insertions(+), 19 deletions(-) mode change 100755 => 100644 example/collatz.igo mode change 100755 => 100644 example/make_fibonacci.gomacro diff --git a/example/arith.gomacro b/example/arith.gomacro index f8ff3d6e..de9bf488 100755 --- a/example/arith.gomacro +++ b/example/arith.gomacro @@ -1,7 +1,5 @@ #!/usr/bin/env gomacro -:fast - func BenchmarkArith(n int) int { total := 0 for i := 0; i < n; i++ { diff --git a/example/collatz.gomacro b/example/collatz.gomacro index ad7b1fdd..479fd0d0 100755 --- a/example/collatz.gomacro +++ b/example/collatz.gomacro @@ -1,7 +1,5 @@ #!/usr/bin/env gomacro -:fast - func collatz(n int) { for n > 1 { if n&1 != 0 { diff --git a/example/collatz.igo b/example/collatz.igo old mode 100755 new mode 100644 diff --git a/example/embedded_field.gomacro b/example/embedded_field.gomacro index b83a66d0..0f7a6007 100755 --- a/example/embedded_field.gomacro +++ b/example/embedded_field.gomacro @@ -1,8 +1,8 @@ #!/usr/bin/env gomacro -:fast - type Pair struct{ a, b int } type Triple struct {Pair; c int} var t Triple + +println(t) diff --git a/example/fibonacci.gomacro b/example/fibonacci.gomacro index 72e7b85b..bfa5f377 100755 --- a/example/fibonacci.gomacro +++ b/example/fibonacci.gomacro @@ -1,7 +1,5 @@ #!/usr/bin/env gomacro -:fast - func fibonacci(n uint) uint { if n <= 2 { return 1 diff --git a/example/make_fibonacci.gomacro b/example/make_fibonacci.gomacro old mode 100755 new mode 100644 diff --git a/fast/func1ret1.go b/fast/func1ret1.go index ab084e55..7f0589be 100644 --- a/fast/func1ret1.go +++ b/fast/func1ret1.go @@ -8301,13 +8301,3 @@ func (c *Comp) func1ret1(t xr.Type, m *funcMaker) func(*Env) r.Value { } return nil } -func (c *Comp) func_ret1(t xr.Type, m *funcMaker) func(*Env) r.Value { - switch t.ReflectType().NumIn() { - case 0: - return c.func0ret1(t, m) - case 1: - return c.func1ret1(t, m) - default: - return nil - } -} diff --git a/main.go b/main.go index 49993815..4e62746c 100644 --- a/main.go +++ b/main.go @@ -39,8 +39,11 @@ func main() { var cmd Cmd cmd.Init() + cmd.Options |= base.OptFastInterpreter // use fast interpreter by default + + // cmd.Options |= base.OptShowTime // | base.OptTrapPanic // | base.OptShowAfterMacroExpansion // | base.OptShowAfterParse // | base.OptDebugMacroExpand // | base.OptDebugQuasiquote + cmd.ParserMode |= parser.Trace & 0 - cmd.Options |= base.OptShowTime & 0 // base.OptTrapPanic // | base.OptShowAfterMacroExpansion // | base.OptShowAfterParse // | base.OptDebugMacroExpand // | base.OptDebugQuasiquote err := cmd.Main(args) if err != nil {