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