News for hackers. Stuff that matters.
Re:Why Lisp Syntax Works by andsoitis on Monday June 05, 2023 @10:59AM (#36197117)
> No they're not. Yours is wrong. Multiplication has higher priority than addition so the order of evaluation begins with (x * 2) not (1 + x).

OK, I shouldn't have gone that far.

FWIW, modulus has the same operator precedence as multiplication and division.

So really, it is more like:

(- (+ 1 (* x 2))

   (mod 3 x))
or using the increment function:

(- (1+ (* x 2))

   (mod 3 x))
Re:Why Lisp Syntax Works by _dain_ on Monday June 05, 2023 @11:14AM (#36197371)
Alright well I guess this is an object lesson in why infix notation is bad -- nobody can remember all the precedence rules once you get beyond +-*/^.
Re:Why Lisp Syntax Works by andsoitis on Monday June 05, 2023 @11:16AM (#36197418)
We'll call it even :-)