Hello!

I found a-b-c and a-b -c give different result. Anyone knows if this

is following the language specification or not?

a = 20

b = 19

c=3

pp! a-b -c

pp! a-b-c

gives

a - (b - c) # => 4

(a - b) - c # => -2

Hello!

I found a-b-c and a-b -c give different result. Anyone knows if this

is following the language specification or not?

a = 20

b = 19

c=3

pp! a-b -c

pp! a-b-c

gives

a - (b - c) # => 4

(a - b) - c # => -2

Wow. First case definitely looks like a bug. Any language where `a - b - c`

would become `a - (b - c)`

?

The problem is that `a-b -c`

becomes `a - (b - c)`

while `a-b-c`

becomes `(a - b) - c`

. Spaces shouldnâ€™t change the result.

BTW

```
a = 20
b = 19
c=3
pp! a&-b &-c
pp! a&-b&-c
```

```
(a &- b) &- c # => -2
(a &- b) &- c # => -2
```

Itâ€™s a bug, please report it in GitHub.

Itâ€™s hard to fix.

Meh, itâ€™s very easy to fix.

5 Likes

Great! I hope this will be included soon!

The language specification for these things is â€śTry it in Ruby. If you get a different result than Ruby then itâ€™s a bugâ€ť.

1 Like

Classic Ary

I ended up closing the PR because Iâ€™m not sure itâ€™s the best way to fix it.

Youâ€™ll have to hope someone else will fix it then.