News for hackers. Stuff that matters.
Re:Programming Without Variables by tehwalrus on Friday September 13, 2013 @04:12AM (#6379238)
> Next week, we'll look at what such a data structure might be.

    (8 . (4 . (2 . (1 . NIL))))
(There's a rage face to accompany this answer, the one for an overexcited noob who knew an answer, but rage faces don't belong on HN.)

(I'm unclear whether the array version should include the 1, since it is not "counted").

Re:Programming Without Variables by dborg on Friday September 13, 2013 @08:41AM (#6380038)
Actually you'd want to save it as (1 . (2 . (4 . (8 . NIL)))) since o/w you'd still get quadratic time complexity as you need to unpack your whole list when you add the next value.
Re:Programming Without Variables by tehwalrus on Friday September 13, 2013 @09:47AM (#6380379)
True! I forgot that you only keep a pointer to the start.
Re:Programming Without Variables by dllthomas on Friday September 13, 2013 @11:14AM (#6381003)
or build it lazily...