On 2016-09-05 21:14, Jeremy Steward wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hey Amirouche,
| (define (lazy-iota count) (let loop ((i 0)) (lambda () (unless (eq?
| i count) (cons i (loop (1+ i)))))))
|
| (define iota3 (lazy-iota 3))
|
| (pk (iota3))
|
| The first time `lazy-iota' is called it returns a procedure that is
| bound to `count'. Then you can call that procedure to get a pair
| with the first value and a procedure which will allow to retrieve
| the rest.
This seems very similar to SRFI 121 (generators) and SRFI 127 (Lazy
Sequences).
Thanks for the pointer.
Is there something particularly different about this implementation?
Values generated by traversi-map are chained which means what actually
travels in the stream is the history list of values with the first
value being the last created value. It allows to backtrack to previous
values. (This is not the case of lazy-iota)
I can't find it anymore in Tinkerpop documentation [0] so maybe it's
not a useful feature.
[0] http://tinkerpop.apache.org/docs/current/reference/#traversal