Skip to content

Commit

Permalink
switched to fast interpreter by default. to use classic interpreter, …
Browse files Browse the repository at this point in the history
…type :classic at REPL
  • Loading branch information
cosmos72 committed Jun 29, 2017
1 parent 853c4b7 commit 47f28a0
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 19 deletions.
2 changes: 0 additions & 2 deletions example/arith.gomacro
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env gomacro

:fast

func BenchmarkArith(n int) int {
total := 0
for i := 0; i < n; i++ {
Expand Down
2 changes: 0 additions & 2 deletions example/collatz.gomacro
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env gomacro

:fast

func collatz(n int) {
for n > 1 {
if n&1 != 0 {
Expand Down
Empty file modified example/collatz.igo
100755 → 100644
Empty file.
4 changes: 2 additions & 2 deletions example/embedded_field.gomacro
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 0 additions & 2 deletions example/fibonacci.gomacro
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env gomacro

:fast

func fibonacci(n uint) uint {
if n <= 2 {
return 1
Expand Down
Empty file modified example/make_fibonacci.gomacro
100755 → 100644
Empty file.
10 changes: 0 additions & 10 deletions fast/func1ret1.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 47f28a0

Please sign in to comment.