executable logs added by mario-goulart on Thu Sep 22 19:52:19 2011

;;;
;;; app.scm
;;;
(define (do-log thing)
  (with-output-to-file "log-file"
    (lambda ()
      (pp `(log ,(current-seconds) ,thing)))
    append:))

(do-log "foo")
(do-log "foo")
(do-log "bar")


;;;
;;; log-analyzer.scm
;;;
(define *foo* 0)

(define (log secs thing)
  (when (equal? thing "foo")
    (set! *foo* (+ *foo* 1))))

(load "log-file")
(print *foo* " occurrences of foo")



$ csi -s app.scm
$ csi -s log-analyzer.scm
2 occurrences of foo