Changeset 35824 in project


Ignore:
Timestamp:
07/09/18 17:46:02 (9 days ago)
Author:
kon
Message:

ren vars, use orig read-file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/5/apropos-srfi/trunk/apropos-srfi-csi.scm

    r35818 r35824  
    2727;;; File Utilities
    2828
    29 (define (read-file #!optional (port (current-input-port)))
    30   (let loop ((xs '()))
    31     (let ((x (read port)))
    32       (if (eof-object? x)
    33         (##sys#fast-reverse xs)
    34         (loop (cons x xs)) ) ) ) )
     29(define (read-file #!optional (port ##sys#standard-input) (reader read) max)
     30  ;
     31  (define (slurp port)
     32    (do ((x (reader port) (reader port))
     33         (i 0 (fx+ i 1))
     34         (xs '() (cons x xs)) )
     35      ((or (eof-object? x) (and max (fx>= i max))) (##sys#fast-reverse xs)) ) )
     36  ;
     37  (if (port? port)
     38    (slurp port)
     39          (call-with-input-file port slurp) ) )
    3540
    3641;;
     
    8186  (let* (
    8287    (cmdlin (read-line))
    83     #;(args (string-split cmdlin))
    8488    (args (with-input-from-string cmdlin read-file))
    8589    (arg (and (not (null? args)) (car args)))
Note: See TracChangeset for help on using the changeset viewer.