The Lambda Lab
/
projects
/
scratchy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
609bba7
)
Add expression evaluation.
author
Tim Vaughan
<tgvaughan@gmail.com>
Fri, 3 May 2019 10:34:56 +0000
(12:34 +0200)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Fri, 3 May 2019 10:34:56 +0000
(12:34 +0200)
burrow.scm
patch
|
blob
|
history
diff --git
a/burrow.scm
b/burrow.scm
index
c258311
..
afdee12
100644
(file)
--- a/
burrow.scm
+++ b/
burrow.scm
@@
-135,6
+135,7
@@
(define (serve-record record path config)
(match record
(('shell command) (serve-shell-command command))
(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)
((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))))
(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)
;;; main
(define (main)
@@
-174,9
+179,9
@@
(run-server (make-server-config root hostname port))
(error "Invalid port argument." port))))))
(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)
;; (test)