Quoth Alex Shinn on Prickle-Prickle, the 8th of Confusion: > Now, if we have a whole program or library which consistently uses > lazy streams instead of lists, we can import srfi-41 renaming all > the stream-* bindings by removing the stream- prefix.
Interesting idea; the attached program will, however, reliably cause Chicken to SIGSEGV.
(require-library srfi-41) (import (rename srfi-41 (stream? list?) (stream-pair? pair?) (stream-null? null?) (stream-occupied? occupied?) (stream-null null) (stream-cons cons) (stream-lambda lambda) (stream-car car) (stream-cdr cdr) (stream-of constantly) (stream-let let) (stream-match match) (stream-append append) (stream-concat concat) (stream-drop drop) (stream-drop-while drop-while) (stream-filter filter) (stream-fold fold) (stream-for-each for-each) (stream-map map) (stream-from from) (stream-iterate iterate) (stream-length length) (stream-range range) (stream-ref ref) (stream-reverse reverse) (stream-scan scan) (stream-unfold unfold) (stream-unfolds unfolds) (stream-zip zip) (stream-intersperse intersperse) (stream-split split) (stream-member member) (stream-partition partition) (stream-finds finds) (stream-find find) (stream-remove remove) (stream-every every) (stream-any any) (stream-and and) (stream-or or) (stream-fold-right fold-right) (stream-fold-right-one fold-right-one) (stream-assoc assoc) (stream-equal? equal?) (stream-quick-sort quick-sort) (stream-insertion-sort insertion-sort) (stream-maximum maximum) (stream-minimum minimum) (stream-max max) (stream-min min) (stream-sum sum) (odd-numbers-stream odd-numbers) (even-numbers-stream even-numbers) (cardinal-numbers-stream cardinal-numbers) (natural-numbers-stream natural-numbers) (prime-numbers-stream prime-numbers) (hamming-sequence-stream hamming-sequence))) (define (factorial n) (ref (scan * 1 (from 1))) n) (factorial 3)
_______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users