5 (for-each eval (with-input-from-file "garden.scm" read-list))
6 (define (pad-string o max-len)
7 (let* ((s (->string o))
10 (string-take s max-len)
11 (conc s (make-string (- max-len n) #\space)))))
12 (define (print-rule n)
13 (print (make-string n #\-)))
14 (let* ((headers '("Owner" "Created" "Plant Stage"))
15 (colwidths '(20 30 15))
16 (total-width (apply + colwidths)))
17 (apply print (map pad-string headers colwidths))
18 (print-rule total-width)
21 (let ((g (with-input-from-file garden-file read)))
23 (with-output-to-file garden-file (lambda () (write g)))
24 (let ((fields (list (garden-prop 'user g)
25 (seconds->string (garden-prop 'created g))
27 (apply print (map pad-string fields colwidths)))))
29 (print-rule total-width))))
32 => ./ Return to the μBotany start page