Hacker News new | past | comments | ask | show | jobs | submit login

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.



And thus forces programmer to think about the order of non-commutative operations.


The 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.


No different from C / Java / most others.


Oh, 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




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: