Changeset 35825 in project


Ignore:
Timestamp:
07/09/18 17:46:15 (5 months ago)
Author:
kon
Message:

ren vars, use orig read-file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/5/apropos/trunk/apropos.scm

    r35819 r35825  
    8585;;; File Utilities
    8686
    87 (define (read-file #!optional (port (current-input-port)))
    88   (let loop ((xs '()))
    89     (let ((x (read port)))
    90       (if (eof-object? x)
    91         (##sys#fast-reverse xs)
    92         (loop (cons x xs)) ) ) ) )
     87(define (read-file #!optional (port ##sys#standard-input) (reader read) max)
     88  ;
     89  (define (slurp port)
     90    (do ((x (reader port) (reader port))
     91         (i 0 (fx+ i 1))
     92         (xs '() (cons x xs)) )
     93      ((or (eof-object? x) (and max (fx>= i max))) (##sys#fast-reverse xs)) ) )
     94  ;
     95  (if (port? port)
     96    (slurp port)
     97          (call-with-input-file port slurp) ) )
    9398
    9499;;
     
    12331238  (let* (
    12341239    (cmdlin (read-line))
    1235     (iargs (with-input-from-string cmdlin read-file))
    1236     (aargs (parse-csi-apropos-arguments iargs)) )
     1240    (args (with-input-from-string cmdlin read-file))
     1241    (apropos-args (parse-csi-apropos-arguments args)) )
    12371242    ;NOTE will not dump the symbol-table unless explicit ; use '(: (* any))
    12381243    (cond
    1239       ((null? aargs)
     1244      ((null? apropos-args)
    12401245        (display-apropos-help) )
    1241       ((null? (cdr aargs))
    1242         (apply apropos (car aargs) (apropos-default-options)) )
     1246      ((null? (cdr apropos-args))
     1247        (apply apropos (car apropos-args) (apropos-default-options)) )
    12431248      (else
    1244         (apply apropos aargs) ) ) ) )
     1249        (apply apropos apropos-args) ) ) ) )
    12451250
    12461251;;; Main
Note: See TracChangeset for help on using the changeset viewer.