News for hackers. Stuff that matters.
Re:Programming Without Variables by wging on Friday September 13, 2013 @03:34AM (#6379166)
Part of the point seems to be to explain the efficient implementation of such an approach. (How would you write GHC if you didn't have it available...?) Try to translate your code into C++...
Re:Programming Without Variables by crntaylor on Friday September 13, 2013 @03:37AM (#6379170)
I don't write C++, but if it has linked lists then at least the first one should be trivial. The second one would probably involve function pointers.

Maybe his point was that you need to use a linked list rather than an array to get an efficient solution? Coming from a Scheme/ML/Haskell background I tend to view linked lists as much simpler than arrays!

Re:Programming Without Variables by jfarmer on Friday September 13, 2013 @03:54AM (#6379207)
Consider the author concluded with

> In effect, the whole idea of an array is built on being able to change part of it, and if we intend to avoid changing memory once we have put values into it, we need another kind of data structure entirely. Next week, we'll look at what such a data structure might be.

I'm assuming that a linked list is precisely the data structure he'll introduce next week. ;)