2 # This script is intended as main script for packnl embedding, it
3 # dispatches to the command of the first argument.
7 (define (set-int K V) (set K (int V 0 10)))
10 (map (curry set-int K) (clean empty? (parse V "\\s*,?\\s*" 0))))
12 (define (set-list K V)
13 (map (curry set K) (clean empty? (parse V "\\s*,?\\s*" 0))))
16 'FILE "hourglass.conf"
19 ("listener.ports" set-ints)
21 ("listener.activity.dir" set)
22 ("control.action" set)
25 ("control.extra.dat" set)
26 ("control.usage.dat" set)
27 ("control.usage.tmp" set)
35 (define (setting LINE)
36 (when (regex "^\\s([^;#][^=]*)=(.*)" LINE 0)
37 (let ((KV (map trim (list $1 $2))))
38 (if (lookup (KV 0) KEYS) (apply $it (list (sym (KV 0)) (KV 1)))))))
40 (map setting (parse (or (read-file FILE) "") "\n"))
45 (if (exists file? (list (main-args 1)
46 (string (main-args 1) ".lsp")))
48 (write-line 2 (string "Unknown command " (main-args 1))))