This is the mail archive of the guile@cygnus.com mailing list for the guile project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
below is stuff i use from thud (munge to taste). thi -------------------- (define (make-dic) (make-array '() 431)) ;; Timestamps for files. ;; (or (defined? 'file-timestamps) ; for now (define file-timestamps (make-dic)) ) ; for now ;; File changed since last check? As a side effect, the timestamp is updated. ;; (define (file-changed? file) (define cur-ts (stat:mtime (stat file))) (define last-ts (hashq-ref file-timestamps file)) (d-set! file-timestamps file cur-ts) (or (not last-ts) (not (= cur-ts last-ts)))) (define (include-th-file filename) (log-event-verbosely 'including filename) (and (file-changed? filename) (begin (call-with-input-file filename (lambda (p) (call-with-current-continuation (lambda (return) (let loop ((form (read p))) (and (eof-object? form) (return #f)) (scan-dispatch form) (loop (read p))))))))) (log-event 'done 'including))