News for hackers. Stuff that matters.
Re:Manipulate Functions with the J Language by Govindae on Saturday July 29, 2017 @08:50PM (#14883812)
'2+34' is unambiguously different from '43+2' (the former evaluates to 14 while the latter is 24)

I really hope the markdown has mangled this.

Re:Manipulate Functions with the J Language by avmich on Sunday July 30, 2017 @01:35AM (#14884573)
Me too. I'm trying to decipher what was typed, and not sure if I get it right. I'll try with spaces.

So, 2 + 3 * 4 is indeed 14 in J. The reason is J does calculations from right to left, so first 3 is multiplied to 4 making 12 and then 2 is added to that making 14.

The expression 4 * 3 + 2 would evaluate in J to 20 - not to 24. That's because first 3 + 2 makes 5 and then 4 * 5 makes 20. All verbs in J are of equal priority and evaluated right to left - no exceptions for arithmetical + - * % they are all equal and only right to left order matters.

May be I got it wrong and it wasn't 2 + 3 * 4 versus 4 * 3 + 2 but something else which would make 14 and 24 as results. But may be it's just a typo.