Closed sbinet closed 6 years ago
the following fails in ng:
ng
ng> a := 0x0101 ng> b := 0x1001 ng> a^b ng eval panic: binOp type mismatch Left: 257 (int), Right: 4097 (int) op: ^ goroutine 1 [running]: runtime/debug.Stack(0x4c, 0x0, 0x0) /home/binet/sdk/go/src/runtime/debug/stack.go:24 +0xa7 runtime/debug.PrintStack() /home/binet/sdk/go/src/runtime/debug/stack.go:16 +0x22 neugram.io/ng/eval.(*Program).Eval.func1(0xc4200e2300, 0xc42013d630, 0xc42013d618) /home/binet/work/gonum/src/neugram.io/ng/eval/eval.go:473 +0x1ea panic(0xaf2ca0, 0xc4201181b0) /home/binet/sdk/go/src/runtime/panic.go:502 +0x229 neugram.io/ng/eval.binOp(0xd, 0xaf1d20, 0xc420132190, 0xaf1d20, 0xc420132198, 0x1, 0xc3b9c0, 0x182, 0x0) /home/binet/work/gonum/src/neugram.io/ng/eval/op.go:577 +0x667b neugram.io/ng/eval.(*Program).evalExpr(0xc4200e2300, 0xc41aa0, 0xc420120100, 0x0, 0x0, 0x0) /home/binet/work/gonum/src/neugram.io/ng/eval/eval.go:1478 +0x3001 neugram.io/ng/eval.(*Program).evalStmt(0xc4200e2300, 0xc424a0, 0xc4201143f0, 0x0, 0x0, 0x0) /home/binet/work/gonum/src/neugram.io/ng/eval/eval.go:882 +0x3c91 neugram.io/ng/eval.(*Program).Eval(0xc4200e2300, 0xc424a0, 0xc4201143f0, 0xc42008c1e0, 0x0, 0x0, 0x0, 0xc3d360, 0xc4201181c0) /home/binet/work/gonum/src/neugram.io/ng/eval/eval.go:494 +0x341 main.handleResult(0x1, 0xc4201181a0, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) /home/binet/work/gonum/src/neugram.io/ng/ng.go:393 +0x72b main.loop(0xc400000000) /home/binet/work/gonum/src/neugram.io/ng/ng.go:385 +0x5d2 main.main() /home/binet/work/gonum/src/neugram.io/ng/ng.go:147 +0x5be ng: ng eval panic: binOp type mismatch Left: 257 (int), Right: 4097 (int) op: ^
the following fails in
ng
: