6 ms·
Common Lisp FTW: ? (expt 2 3 4) > Error: Too many arguments in call to #<Compiled-function EXPT #x3000000A6C2F>: > 3 arguments p
by lisper 15y ago
Common Lisp FTW:
? (expt 2 3 4)
> Error: Too many arguments in call to #<Compiled-function EXPT #x3000000A6C2F>:
> 3 arguments provided, at most 2 accepted.
- adobriyan 15y agoAnd thus forces programmer to think about the order of non-commutative operations.
- baddox 15y agoThe fact that infix notation removes the need to think about that is a bad thing, because infix notation is inherently ambiguous unless you litter the expression with parentheses or explicitly think about operator precedence and associativity. Infix notation just appears to be easier on the mind, because we're first taught arithmetic using it.
- tybris 15y agoNo different from C / Java / most others.
- lisper 15y agoOh, it's different all right: ? (expt (expt 2 3) 4) 4096 ? (reduce 'expt '(2 3 4)) 4096 ? (expt 2 (expt 3 4)) 2417851639229258349412352 ? (expt 3 (expt 4 5)) 373391848741020043532959754184866588225409776783734007750636931722079040617265251229993688938803977220468765065431475158108727054592160858581351336982809187314191748594262580938807019951956404285571818041046681288797402925517668012340617298396574731619152386723046235125934896058590588284654793540505936202376547807442730582144527058988756251452817793413352141920744623027518729185432862375737063985485319476416926263819972887006907013899256524297198527698749274196276811060702333710356481