top | item 40418592 (no title) rileyphone | 1 year ago Not really because the ordering is unambiguous given the parens. No need for operator precedence rules like PEMDAS. discuss order hn newest munificent|1 year ago Oh, you still have to worry about precedence. Consider: var x = 123 print(-x.abs()) Or even: print(-123.abs()) What do those print? Do they print the same thing? rileyphone|1 year ago Unary operators are still operators. The integer parsing rules are probably different. In Lisp, -x would be a symbol, and the proper analog to -123 would be (- x) eg. load replies (1)
munificent|1 year ago Oh, you still have to worry about precedence. Consider: var x = 123 print(-x.abs()) Or even: print(-123.abs()) What do those print? Do they print the same thing? rileyphone|1 year ago Unary operators are still operators. The integer parsing rules are probably different. In Lisp, -x would be a symbol, and the proper analog to -123 would be (- x) eg. load replies (1)
rileyphone|1 year ago Unary operators are still operators. The integer parsing rules are probably different. In Lisp, -x would be a symbol, and the proper analog to -123 would be (- x) eg. load replies (1)
munificent|1 year ago
rileyphone|1 year ago