3 ms·
Not if it's s-expression-based! (laughs in smug lisp weenie)
by bitwize 6mo ago
Not if it's s-expression-based! (laughs in smug lisp weenie)
- aleph_minus_one 6mo agoOr, if the programming language uses infix binary operators: Not if the programming language has evaluation order from left to right, e.g. 2+3*4 is evaluated as (2+3)*4. For example J uses this kind of evaluation.
- lmz 6mo agoSmalltalk also.
- Someone 6mo agoJ is APL-inspired, and APL is right-associative, so that would surprise me. https://www.jsoftware.com/help/jforc/preliminaries.htm#_Toc191734304 https://www.jsoftware.com/help/jforc/preliminaries.htm#_Toc1... agrees with that, saying “All J verbs (functions and operators) have the same priority and associate right-to-left. For example, a b + c is equivalent to a * (b + c), not (a * b) + c.”* Your point about not needing operator precedence still stands, though.
- aleph_minus_one 6mo ago> J is APL-inspired, and APL is right-associative, so that would surprise me. You are indeed right (it has been quite a long time since I experimented with J): > https://www.jsoftware.com/help/jforc/preliminaries.htm https://www.jsoftware.com/help/jforc/preliminaries.htm (scroll down to "Order of Evaluation")