;; Plant new seed ;; (lambda (uri) (for-each eval (with-input-from-file "garden.scm" read-list)) (let ((query (uri-query uri))) (if (null? query) (begin (serve-document-header (ext->mime "gmi")) (print "No account specified.") (print "\n=> /microbotany/ Return to μBotany to create one".)) (let ((hash (symbol->string (caar query)))) (condition-case (let* ((g (with-input-from-file (make-pathname "accounts" hash) read)) (user (garden-prop 'user g))) (with-output-to-file (make-pathname "accounts" hash) (lambda () (write (make-garden user)))) (redirect-permanent (update-uri uri path: '(/ "microbotany" "view.scm") query: `((,hash . #t))))) (o (exn) (serve-document-header (ext->mime "gmi")) (print "That account does not exist.") (print "\n=> /microbotany/ Return to μBotany to create one".)))))))