I’m struggling to write a generator that takes another generator and buffers its result.
For example, I want to compute the delta between two coordinate pairs which are yielded from a generator one by one, e.g.
[x1, y1] and
Preferably I’d have a
partitionGen gen that takes any other gen and a partition size, e.g.
partitionGen(2, coordsGen) but I haven’t been able to implement something that would do the job. Still can’t wrap my head around generators.
Thanks for the help in advance!