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(0xc420122180, 0xc42013b630, 0xc42013b618) /home/binet/work/gonum/src/neugram.io/ng/eval/eval.go:473 +0x1ea panic(0xaf4ec0, 0xc42011ac00) /home/binet/sdk/go/src/runtime/panic.go:502 +0x229 neugram.io/ng/eval.binOp(0xc, 0xaf3f40, 0xc420200c58, 0xaf3f40, 0xc420200c60, 0x1, 0xc3df70, 0x182, 0x0) /home/binet/work/gonum/src/neugram.io/ng/eval/op.go:704 +0x7ec3 neugram.io/ng/eval.(*Program).evalExpr(0xc420122180, 0xc44060, 0xc4201170c0, 0x0, 0x0, 0x0) /home/binet/work/gonum/src/neugram.io/ng/eval/eval.go:1478 +0x3001 neugram.io/ng/eval.(*Program).evalStmt(0xc420122180, 0xc44a60, 0xc420115830, 0x0, 0x0, 0x0) /home/binet/work/gonum/src/neugram.io/ng/eval/eval.go:882 +0x3c91 neugram.io/ng/eval.(*Program).Eval(0xc420122180, 0xc44a60, 0xc420115830, 0xc4201700c0, 0x0, 0x0, 0x0, 0xc3f920, 0xc42011ac10) /home/binet/work/gonum/src/neugram.io/ng/eval/eval.go:494 +0x341 main.handleResult(0x1, 0xc42011abf0, 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
: