Stream Types #334
chebert
started this conversation in
Cool Coalton Code
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've written two stream types for my application which I'll share below.
To avoid recomputation the streams depend on Lisp to implement a memoize-thunk.
The first stream type is like a lazy list whose tails are delayed.
The second stream type is like the first, but is guaranteed to never be empty.
I've found the second stream type to be more useful, since a lot of times with streams I want an infinite set of integer ids, random numbers, etc., and there is no point in checking if the stream is empty if I know its impossible.
Beta Was this translation helpful? Give feedback.
All reactions