Re:The Idea of Lisp
by DonaldFisk on Friday December 16, 2016 @01:59PM
(#13195745)
And if you want a new array whose first element is increased by one, you either have to allocate space for the entire array, modify the array, or use a different data structure.
[ Parent
| on HN ]
Re:The Idea of Lisp
by smitherfield on Friday December 16, 2016 @02:09PM
(#13195827)
No you don't, you merely need each index into an array to be a monad over all possible values it can contain. An array is itself and modifications are (take as arguments and return) its indices.
> you merely need each index into an array to be a monad over all possible values it can contain
Now keep a straight face and say "L1 cache" once again.
Re:The Idea of Lisp
by DonaldFisk on Friday December 16, 2016 @03:57PM
(#13196738)
And how is that implemented under the hood?
Re:The Idea of Lisp
by smitherfield on Friday December 16, 2016 @04:37PM
(#13197090)
Same as in a higher-level statically typed imperative language: mutable arrays contained within larger dynamic buffers for amoritized constant-time append and prepend.
Re:The Idea of Lisp
by DonaldFisk on Saturday December 17, 2016 @09:00AM
(#13200728)
So it isn't really functional at all. It just hides the side effects behind a lot of complexity.