Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Why MIT switched from Scheme to Python. Parent comment
foo = (1,2,3) bar = (4,5,6) print cons(foo, bar) print car(foo)
<function <lambda> at 0x00B3F430> Traceback (most recent call last): File "./test.py", line 14, in <module> print car(foo) File "./test.py", line 5, in car return p(lambda a,b: a) TypeError: 'tuple' object is not callable
Try instead:
car(cons(1,2)) -> 1 cdr(cons(1,2)) -> 2 car(cons('a', cons(2, 3))) -> 'a'