Pf::BlockList(T)
Inherits Enumerable / Reference / Object
A simple persistent linked list of blocks, storing at most 8x Ts per block. The block that you append to is copied wholesale, which is usually cheap enough while giving you semi-bearable locality during iteration (e.g. if T is pointer- sized, you get 64-byte blocks which are in theory big friends with the CPU, but let me not make myself sound like I understand what I'm talking about here!)
Constructors
Class methods
Instance methods
Yields elements in this list in front-to-back order.
This method may allocate some buffer memory because it must reverse the list to yield elements in the correct order.
NOTE: All Enumerable methods eventually end up calling this method,
so you must evaluate the costs (if that matters to you!)
Returns the part of this list before the last element. If this list is empty, returns an empty list.
Yields elements in this list in back-to-front order.
Note that this is the memory order of BlockList, so this method is
a pure traversal (compared to e.g. each, which does additional work
to give you elements in expected order).
Like includes?, but faster for BlockList in particular since it iterates
in memory-order (using reverse_each) vs. Enumerable's includes? which
uses each.