Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I lean toward "if a b c" being a true primitive, due to it being one of the special forms in Lisp. This is necessary to avoid evaluating the arguments in the road-not-taken, without fexprs, and I daresay that would be a distraction at the moment.

It's also embodied in actual machine words. The actual verbiage of "if a then b else c" is clearly less important, C elides the "then" after all.

I'm presuming you mean the construct, not the happenstance of how it's spelled out, because you're clearly referring to the electron, not the word for amber-the-stone which we happened to adopt for it.



The historical truth is that Lisp had COND first; IF was added later. Also, LAMBDA before LET.

MacCarthy writes, in History of Lisp:

I invented conditional expressions in connection with a set of chess legal move routines I wrotein FORTRAN for the IBM704 at M.I.T. during1957-58. This program did not use list processing. The IF statement provided in FORTRAN1 and FORTRAN2 was very awkward to use, and it was natural to invent a function XIF(M, N1, N2) whose value was N1 or N2 according to whether the expression M was zero or not.

Yet, no such thing was added to Lisp, initially. The 1960 Lisp 1 Programmer's Manual only lists COND.


An interesting historical note, but it says nothing about the relative 'primitiveness' of COND vs IF.

It's not uncommon at all in mathematics to build a system with certain axioms, and then improve them later, when it's realized that simpler axioms can be used to build more complex constructs.


Either one of cond and if can be primitive and the other one a macro.




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

Search: