X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=scratchy.git;a=blobdiff_plain;f=burrow.scm;h=afdee1281bfd7ca9c4f543fca54a04fd3161ab66;hp=c258311c96db489b0ab012d08379f6cedebbdb1f;hb=80b558dda9342206b8aab33bb7b967bfe9fb0553;hpb=609bba713d00f7fe14b8c1369985f9b4be4ecd18 diff --git a/burrow.scm b/burrow.scm index c258311..afdee12 100644 --- a/burrow.scm +++ b/burrow.scm @@ -135,6 +135,7 @@ (define (serve-record record path config) (match record (('shell command) (serve-shell-command command)) + (('eval expression) (serve-expression expression)) ((type display-string selector host port) (print type display-string "\t" selector "\t" host "\t" port "\r")) ((type display-string selector host) @@ -156,6 +157,10 @@ (let-values (((in-port out-port id) (process command))) (for-each serve-info-record (read-lines in-port)))) +(define (serve-expression expression) + (for-each serve-info-record + (string-split (conc (eval expression)) "\n"))) + ;;; main (define (main) @@ -174,9 +179,9 @@ (run-server (make-server-config root hostname port)) (error "Invalid port argument." port)))))) -(main) +;; (main) -;; (define (test) -;; (run-server (make-server-config "gopher-root" "localhost" 70))) +(define (test) + (run-server (make-server-config "gopher-root" "localhost" 70))) ;; (test)