[[project @ 2001-08-04 21:05:06 by ghouston] ghouston**20010804210506 Ignore-this: de9f03e02936dcee1f34ad2b922cc5a4 * utilities.scm (delete, filter, first, fold, fold-right, any, every): don't export, to avoid replacing (srfi srfi-1) definitions. * awk.scm, defrec.scm, glob.scm, scsh.scm, rx/parse.scm, procobj.scm, utilities.scm: rx/re-subst.scm, rx/re-syntax.scm, rx/re.scm, rx/rx-lib.scm: use (srfi srfi-1) for procs removed from utilities.scm. * awk.scm, defrec.scm, glob.scm, rx/parse.scm, rx/re-subst.scm, rx/re-syntax.scm, rx/rx-lib.scm: don't use (scsh utilities). ] hunk ./ChangeLog 25 + * utilities.scm (delete, filter, first, fold, fold-right, any, every): + don't export, to avoid replacing (srfi srfi-1) definitions. + + * awk.scm, defrec.scm, glob.scm, scsh.scm, rx/parse.scm, + procobj.scm, utilities.scm: rx/re-subst.scm, rx/re-syntax.scm, + rx/re.scm, rx/rx-lib.scm: use (srfi srfi-1) for procs removed from + utilities.scm. + + * awk.scm, defrec.scm, glob.scm, rx/parse.scm, rx/re-subst.scm, + rx/re-syntax.scm, rx/rx-lib.scm: don't use (scsh utilities). + hunk ./USAGE 9 -For script usage it's probably more useful to import parts of scsh -individually using the Guile module system. However note that macros -may expand to code that requires additional modules. e.g., `run' is -defined in (scsh syntax), but requires loading (scsh procobj), (scsh -scsh), (scsh fdports) and (scsh syntax-helpers) to execute -sucessfully. This may be a deficiency of the Guile module system. +When writing new software it's probably more useful to import parts of +scsh individually using the Guile module system. However note that +macros may expand to code that requires additional modules. e.g., +`run' is defined in (scsh syntax), but requires loading (scsh +procobj), (scsh scsh), (scsh fdports) and (scsh syntax-helpers) to +execute sucessfully. This may be a deficiency of the Guile module +system. hunk ./USAGE 56 -;; following are defined in (scsh utilities) too, possibly incompatibly: -;; delete filter first fold fold-right any every hunk ./USAGE 101 -;; following are defined in (srfi srfi-1) too, possibly incompatibly: -;; delete filter first fold fold-right any every -(del delete filter first first? nth fold fold-right any every mapv mapv! vector-every? copy-vector initialize-vector vector-append vfold vfold-right check-arg conjoin disjoin negate compose call/cc deprecated-proc deposit-bit-field real->exact-integer) +(del delete first? nth mapv mapv! vector-every? copy-vector initialize-vector vector-append vfold vfold-right check-arg conjoin disjoin negate compose call/cc deprecated-proc deposit-bit-field real->exact-integer) hunk ./awk.scm 6 + :use-module (srfi srfi-1) hunk ./awk.scm 8 - :use-module (scsh utilities) hunk ./defrec.scm 80 - :use-module (scsh utilities) + :use-module (srfi srfi-1) hunk ./glob.scm 17 - :use-module (scsh utilities) + :use-module (srfi srfi-1) hunk ./procobj.scm 14 + :use-module (srfi srfi-1) hunk ./rx/parse.scm 48 - :use-module (scsh utilities) + :use-module (srfi srfi-1) hunk ./rx/re-subst.scm 14 + :use-module (srfi srfi-1) hunk ./rx/re-subst.scm 16 - :use-module (scsh utilities) hunk ./rx/re-syntax.scm 10 - :use-module (scsh utilities) + :use-module (srfi srfi-1) hunk ./rx/re.scm 19 + :use-module (srfi srfi-1) hunk ./rx/rx-lib.scm 7 - :use-module (scsh utilities) + :use-module (srfi srfi-1) hunk ./scsh.scm 9 + :use-module (srfi srfi-1) hunk ./utilities.scm 5 + :use-module (srfi srfi-1) hunk ./utilities.scm 9 -(begin-deprecated - ;; Prevent `export' from re-exporting core bindings. This behaviour - ;; of `export' is deprecated and will disappear in one of the next - ;; releases. - (define delete #f)) - -(export del delete filter first first? nth - fold fold-right - any every +(export del first? nth hunk ./utilities.scm 17 + ;; delete, filter, first, fold, fold-right, any, every: use srfi-1. + ;; first: incompatible with srfi-1. hunk ./utilities.scm 33 -(define (delete pred lis) - (filter (lambda (x) (not (pred x))) lis)) +;(define (delete pred lis) +; (filter (lambda (x) (not (pred x))) lis)) hunk ./utilities.scm 36 -(define (fold kons knil lis) - (let lp ((lis lis) (ans knil)) - (if (pair? lis) - (lp (cdr lis) (kons (car lis) ans)) - ans))) +;(define (fold kons knil lis) +; (let lp ((lis lis) (ans knil)) +; (if (pair? lis) +; (lp (cdr lis) (kons (car lis) ans)) +; ans))) hunk ./utilities.scm 42 -(define (fold-right kons knil lis) - (let recur ((lis lis)) - (if (pair? lis) - (let ((head (car lis))) ; Won't need LIS after RECUR call. - (kons head (recur (cdr lis)))) - knil))) +; (define (fold-right kons knil lis) +; (let recur ((lis lis)) +; (if (pair? lis) +; (let ((head (car lis))) ; Won't need LIS after RECUR call. +; (kons head (recur (cdr lis)))) +; knil))) hunk ./utilities.scm 49 -(define (filter pred list) - (letrec ((filter (lambda (list) - (if (pair? list) - (let* ((head (car list)) - (tail (cdr list)) - (new-tail (filter tail))) - (if (pred head) - (if (eq? tail new-tail) list - (cons head new-tail)) - new-tail)) - '())))) - (filter list))) +; (define (filter pred list) +; (letrec ((filter (lambda (list) +; (if (pair? list) +; (let* ((head (car list)) +; (tail (cdr list)) +; (new-tail (filter tail))) +; (if (pred head) +; (if (eq? tail new-tail) list +; (cons head new-tail)) +; new-tail)) +; '())))) +; (filter list))) hunk ./utilities.scm 62 -(define (first pred list) - (letrec ((lp (lambda (list) - (and (pair? list) - (let ((head (car list))) - (if (pred head) head - (lp (cdr list)))))))) - (lp list))) +; (define (first pred list) +; (letrec ((lp (lambda (list) +; (and (pair? list) +; (let ((head (car list))) +; (if (pred head) head +; (lp (cdr list)))))))) +; (lp list))) hunk ./utilities.scm 80 -(define any first?) +;(define any first?) hunk ./utilities.scm 82 -(define (every pred list) - (or (not (pair? list)) - (let lp ((head (car list)) (tail (cdr list))) - (if (pair? tail) - (and (pred head) (lp (car tail) (cdr tail))) - (pred head))))) ; Tail-call the last PRED call. +; (define (every pred list) +; (or (not (pair? list)) +; (let lp ((head (car list)) (tail (cdr list))) +; (if (pair? tail) +; (and (pred head) (lp (car tail) (cdr tail))) +; (pred head))))) ; Tail-call the last PRED call.