4 ms·
With SRFI 41 (streams) this can be expressed lazily in Scheme, but it is more verbose than Haskell: (import (srfi srfi-41)) (define xs '(a b c)) (s
by rekado 4y ago
With SRFI 41 (streams) this can be expressed lazily in Scheme, but it is more verbose than Haskell:
(import (srfi srfi-41))
(define xs '(a b c))
(stream-zip (stream-from 0) (list->stream xs))
This returns a lazy stream whose values can be evaluated later.
- _glass 4y agoSounds irrational, but it looks much more beautiful for me. My brain says, you should like Haskell, mirroring my experience that static languages with a strong type system are much better for big projects. But my heart knows, I would always prefer Lisp.