aussieplusplus icon indicating copy to clipboard operation
aussieplusplus copied to clipboard

Number-string addition always puts the string first

Open bbrk24 opened this issue 2 years ago • 1 comments

For the following program:

G'DAY MATE!

GIMME 5 + "foo";
GIMME "foo" + 5;
GIMME "" + 5 + "foo";

CHEERS C***!

I would expect this output:

5foo
foo5
5foo

However, the actual output is:

foo5
foo5
5foo

bbrk24 avatar Mar 21 '22 01:03 bbrk24

I think have found the exact line: https://github.com/zackradisic/aussieplusplus/blob/9522366ef0602946420fee19fa2ad6769b773c07/src/runtime/interpreter.rs#L422

This line does b: str + a: any instead of a: any + b: str.

bigyihsuan avatar Mar 21 '22 03:03 bigyihsuan