Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Optional If Expressions. Parent comment
FORTRAN example:
IF ( N ) 10, 20, 30
if N is less than zero, then jump to label 10 if N is zero, then jump to label 20 if N is greater than zero, then jump to label 30
(COND ((= x 1) 'one) ((= x 2) 'two) (T 'not-one-or-two)) if X is 1, then return ONE if X is 2, then return TWO ELSE return NOT-ONE-OR-TWO
In external LISP syntax a COND would have looked similar to this:
(x>1 -> 1, x=0 -> 0, x<1 -> -1)
if X greater than 1, then return 1 if X is 0, then return 0 if X is smaller than 1, then return -1
There are no comments on this comment yet.
FORTRAN example:
Above means: LISP had a COND expression, with multiple condition clauses. An example with three clauses. John McCarthy mentions conditional expressions in this paper from 1958: https://www.softwarepreservation.org/projects/LISP/MIT/AIM-0...In external LISP syntax a COND would have looked similar to this:
Above would mean: