Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== Outdated egg! This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for [[/eggref/5/srfi-41|the CHICKEN 5 version of this egg]], if it exists. If it does not exist, there may be equivalent functionality provided by another egg; have a look at the [[https://wiki.call-cc.org/chicken-projects/egg-index-5.html|egg index]]. Otherwise, please consider porting this egg to the current version of CHICKEN. [[tags: egg]] == srfi-41 SRFI 41 for Chicken Scheme. [[toc:]] == Documentation See the [[http://srfi.schemers.org/srfi-41/srfi-41.html|SRFI-41 Document]]. === Primitive ==== Usage <enscript language=scheme> (require-extension streams-primitive) </enscript> ==== stream? <procedure>(stream? OBJECT) => boolean</procedure> ==== stream-pair? <procedure>(stream-pair? OBJECT) => boolean</procedure> ==== stream-null? <procedure>(stream-null? OBJECT) => boolean</procedure> ==== stream-occupied? <procedure>(stream-occupied? OBJECT) => boolean</procedure> Inverse of {{stream-null?}}. ==== stream-null <constant>stream-null</constant> The null stream value. ==== stream-cons <macro>(stream-cons OBJECT STREAM) => stream</macro> ==== stream-lambda <macro>(stream-lambda FORMALS BODY ...) => procedure</macro> ==== stream-car <procedure>(stream-car STREAM) => *</procedure> ==== stream-cdr <procedure>(stream-cdr STREAM) => stream</procedure> === Derived ==== Usage <enscript language=scheme> (require-extension streams-derived) </enscript> ==== define-stream <macro>(define-stream (NAME [FORMAL...]) BODY...)</macro> ==== stream-of <macro>(stream-of EXPRESSION (VARIABLE in STREAM)/(VARIABLE is EXPRESSION)/PREDICATE ...) => stream</macro> ==== stream-let <macro>(stream-let TAG ((NAME VALUE)...) BODY...)</macro> ==== stream-match <macro>(stream-match STREAM-EXPRESSION CLAUSE...)</macro> ==== stream <macro>(stream OBJECT...) => stream</macro> ==== list->stream <procedure>(list->stream LIST) => stream</procedure> ==== port->stream <procedure>(port->stream [PORT (current-input-port)]) => stream</procedure> ==== stream->list <procedure>(stream->list [COUNT #f] STREAM) => list</procedure> ==== stream-append <procedure>(stream-append STREAM...) => stream</procedure> ==== stream-concat <procedure>(stream-concat STREAM) => stream</procedure> Flatten a stream of streams. ==== stream-drop <procedure>(stream-drop COUNT STREAM) => stream</procedure> ==== stream-drop-while <procedure>(stream-drop-while PREDICATE STREAM) => stream</procedure> ==== stream-filter <procedure>(stream-filter PREDICATE STREAM) => stream</procedure> ==== stream-fold <procedure>(stream-fold FUNCTION BASE STREAM...) => *</procedure> ==== stream-for-each <procedure>(stream-for-each FUNCTION STREAM...) => stream</procedure> ==== stream-map <procedure>(stream-map FUNCTION STREAM...) => stream</procedure> ==== stream-from <procedure>(stream-from FIRST [STEP 1]) => stream</procedure> ==== stream-iterate <procedure>(stream-iterate FUNCTION BASE) => stream</procedure> ==== stream-length <procedure>(stream-length STREAM) => FIXNUM</procedure> ==== stream-range <procedure>(stream-range FIRST PAST [STEP (if (< FIRST PAST) 1 -1)]) => stream</procedure> ==== stream-ref <procedure>(stream-ref STREAM INDEX) => *</procedure> ==== stream-reverse <procedure>(stream-reverse STREAM) => stream</procedure> ==== stream-scan <procedure>(stream-scan FUNCTION BASE STREAM) => stream</procedure> ==== stream-unfold <procedure>(stream-unfold MAPPER PREDICATE GENERATOR BASE) => stream</procedure> ==== stream-unfolds <procedure>(stream-unfolds GENERATOR SEED) => stream</procedure> ==== stream-zip <procedure>(stream-zip STREAM...) => stream</procedure> === Utilities ==== Usage <enscript language=scheme> (require-extension streams-utils) </enscript> ==== stream-intersperse <procedure>(stream-intersperse STREAM OBJECT) => stream</procedure> ==== stream-permutations <procedure>(stream-permutations STREAM) => stream</procedure> ==== file->stream <procedure>(file->stream FILENAME [READER read-char]) => stream</procedure> ==== stream-split <procedure>(stream-split COUNT STREAM) => (values STREAM STREAM)</procedure> ==== stream-unique <procedure>(stream-unique =? STREAM) => stream</procedure> ==== stream-fold-one <procedure>(stream-fold-one FUNCTION STREAM) => stream</procedure> ==== stream-member <procedure>(stream-member =? OBJECT STREAM) => stream</procedure> ==== stream-merge <procedure>(stream-merge <? STREAM ...) => stream</procedure> ==== stream-partition <procedure>(stream-partition PREDICATE STREAM) => stream</procedure> ==== stream-finds <procedure>(stream-finds =? OBJECT STREAM) => stream</procedure> ==== stream-find <procedure>(stream-find =? OBJECT STREAM) => stream</procedure> ==== stream-remove <procedure>(stream-remove PREDICATE STREAM) => stream</procedure> ==== stream-every <procedure>(stream-every PREDICATE STREAM) => boolean</procedure> ==== stream-any <procedure>(stream-any PREDICATE STREAM) => boolean</procedure> ==== stream-and <procedure>(stream-and STREAM) => boolean</procedure> ==== stream-or <procedure>(stream-or STREAM) => boolean</procedure> ==== stream-fold-right <procedure>(stream-fold-right FUNCTION BASE STREAM) => *</procedure> ==== stream-fold-right-one <procedure>(stream-fold-right-one FUNCTION STREAM) => *</procedure> ==== stream-assoc <procedure>(stream-assoc KEY STREAM [=? equal?]) => *</procedure> ==== stream-equal? <procedure>(stream-equal? =? STREAM1 STREAM2) => boolean</procedure> ==== stream-quick-sort <procedure>(stream-quick-sort <? STREAM) => stream</procedure> ==== stream-insertion-sort <procedure>(stream-insertion-sort <? STREAM) => stream</procedure> ==== stream-merge-sort <procedure>(stream-merge-sort <? STREAM) => stream</procedure> ==== stream-maximum <procedure>(stream-maximum <? STREAM) => *</procedure> ==== stream-minimum <procedure>(stream-minimum <? STREAM) => *</procedure> ==== binary-tree-same-fringe? <procedure>(binary-tree-same-fringe? TREE1 TREE2) => boolean</procedure> {{TREE1}} and {{TREE2}} are binary-tree nodes, so either {{()}} or {{pair}}. Lazy version of the ''same fringe''. === Math Utilities ==== Usage <enscript language=scheme> (require-extension streams-math) </enscript> ==== stream-max <procedure>(stream-max STREAM) => *</procedure> ==== stream-min <procedure>(stream-min STREAM) => *</procedure> ==== stream-sum <constant>stream-sum</constant> ==== odd-numbers-stream <constant>odd-numbers-stream</constant> ==== even-numbers-stream <constant>even-numbers-stream</constant> ==== cardinal-numbers-stream <constant>cardinal-numbers-stream</constant> ==== natural-numbers-stream <constant>natural-numbers-stream</constant> ==== prime-numbers-stream <constant>prime-numbers-stream</constant> ==== hamming-sequence-stream <constant>hamming-sequence-stream</constant> == Examples <enscript language=scheme> (use streams) (define (sigma function m n) (stream-fold + 0 (stream-map function (stream-range m (add1 n))))) (define (factorial n) (stream-ref (stream-scan * 1 (stream-from 1)) n)) </enscript> ==== Usage The exports of {{streams-primitive}} and {{streams-derived}} are povided by: <enscript language=scheme> (require-extension streams) </enscript> Or (a synonym) <enscript language=scheme> (require-extension srfi-41) </enscript> == Requirements [[check-errors]] [[combinators]] [[record-variants]] == Author Philip L. Bewig [[/users/kon-lovett|Kon Lovett]] == Version history ; 1.2.4 : Included ''inline-type-checks.scm'' so all includes are egg-local. ; 1.2.3 : ; 1.2.2 : Check for {{stream}} type when ''forcing''; reported by Jim Ursetto. Faster prime number stream; thanks to Matthias Bauer. ; 1.2.1 : ; 1.2.0 : Use of ''record-variants'' & ''combinators''. ; 1.1.0 : Added "srfi-41" modules as synonynom of "streams". ; 1.0.2 : Bug fix for problem w/ use of 'obj' in "streams-utils" reported by Josh Griffith. Better error message for nary stream procedures. ; 1.0.1 : Updated test. ; 1.0.0 : Chicken 4 release. == License Copyright (C) 2007 by Philip L. Bewig of Saint Louis, Missouri, USA. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Copyright (C) 2009 Kon Lovett. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you add 15 to 14?