1 comment

[ 3.1 ms ] story [ 22.3 ms ] thread
example session:

  (llgo) 1+1
  #0 untyped int = 2
  (llgo) x := 1
  x untyped int = 1
  (llgo) x++
  (llgo) x
  #0 int = 2
  (llgo) import "fmt"
  (llgo) fmt.Println("hello world")
  hello world
  #0 int = 12
  #1 error (<nil>) = <nil>
  (llgo) for i := 0; i != 3; i++ {
         fmt.Println(i)
         }
  0
  1
  2
  (llgo) func foo() {
         fmt.Println("hello decl")
         }
  (llgo) foo()
  hello decl
  (llgo) import "golang.org/x/tools/go/types"
  # golang.org/x/tools/go/ast/astutil
  # golang.org/x/tools/go/exact
  # golang.org/x/tools/go/types
  (llgo) types.Eval("1+1", nil, nil)
  #0 golang.org/x/tools/go/types.TypeAndValue = {mode:4 Type:untyped int Value:2}
  #1 error (<nil>) = <nil>