;; ;; ;; srfi-4-utils documentation for the Chicken Scheme module system. ;; (use eggdoc) (define doc `((eggdoc:begin (name "srfi-4-utils") (description "Utility functions for SRFI-4 vectors.") (author (url "http://chicken.wiki.br/users/ivan-raikov" "Ivan Raikov")) (history (version "1.5" "Ported to Chicken 4") (version "1.4" "Build script bug fix") (version "1.3" "Build script updated for better cross-platform compatibility") (version "1.2" "Extended fold and map interface to support multiple vector arguments") (version "1.1" "Added foldi and mapi procedures") (version "1.0" "Initial release")) (requires (url "srfi-42.html" "srfi-42") (url "srfi-4-comprehensions.html" "srfi-4-comprehensions") (url "syntax-case.html" "syntax-case")) (usage "(require-extension srfi-4-utils)") (download "srfi-4-utils.egg") (documentation (p (tt "srfi-4-utils") " contains a set of convenience procedures for " (url "http://srfi.schemers.org/srfi-4/srfi-4.html" "SRFI-4") " vectors: " (tt "fold") ", " (tt "map") ", " (tt "quick-sort!") ". ") (subsection "Procedures" (p "For each value of " (tt "TAG") " in " (tt "{ s8, u8, s16, u16, s32, u32, f32, f64 }") ", " "the following procedures are defined: ") (procedure "TAGvector-fold :: F * X0 * V [* V1 ... VN] -> XN" "where " (tt "F :: V(I) [ * V1(I) ... VN(I)] * AX -> AX")) (procedure "TAGvector-map :: F * V [ * V1 ... VN] -> V") (procedure "TAGvector-foldi :: F * X0 * V [ * V1 ... VN] -> XN" "where " (tt "F :: I * V(I) [ * V1(I) ... VN(I)] * AX -> AX")) (procedure "TAGvector-mapi :: F * V [* V1 ... VN] -> V" "where " (tt "F :: I * V(I) [* V1(I) ... VN(I)] -> V")) (procedure "TAGvector-quick-sort! :: V * ELT< [ * START * END] -> V" "where " (tt "F :: i1 * V(i1) * i2 * V(i2) -> boolean")))) (examples (pre #< (f64vector-map (lambda (v) (* 2 v)) (f64vector 1 2 3)) -> #f64(2.0 4.0 6.0) csi> (f64vector-fold (lambda (v ax) (+ v ax)) (f64vector 1 2 3) 0) -> 6.0 ;; input vector is modified csi> (f64vector-quick-sort! (f64vector 1 4 2 3) (lambda (i1 v1 i2 v2) (< v1 v2))) #f64(1.0 2.0 3.0 4.0) EOF )) (license "Copyright 2007-2009 Ivan Raikov and the Okinawa Institute of Science and Technology This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A full copy of the GPL license can be found at .")))) (if (eggdoc->html doc) (void))