diff options
author | Pjotr Prins | 2023-07-21 12:28:47 +0200 |
---|---|---|
committer | Pjotr Prins | 2023-07-21 12:28:47 +0200 |
commit | 3349ce0a5817e7c3cbc9caf5db8b0ca45d984214 (patch) | |
tree | 7db6305932fdd732bb223a3a8812d438d2d52a1d /gn3-guile | |
parent | 4da2ae5d4c259bfeb82de5d7b4e1d98d3aa3ceca (diff) | |
download | genenetwork3-3349ce0a5817e7c3cbc9caf5db8b0ca45d984214.tar.gz |
This does not work
Diffstat (limited to 'gn3-guile')
-rw-r--r-- | gn3-guile/README.md | 2 | ||||
-rwxr-xr-x | gn3-guile/web/webserver.scm | 17 |
2 files changed, 14 insertions, 5 deletions
diff --git a/gn3-guile/README.md b/gn3-guile/README.md index 944296a..3a9b167 100644 --- a/gn3-guile/README.md +++ b/gn3-guile/README.md @@ -10,6 +10,6 @@ GNU Guile allows you to develop against a live running web server using emacs-ge Note the leading dot. The .guix-shell is defined in `genenetwork3/gn3-guile/web` and loads required packages using GNU Guix. -Next fire up emacs with `emacs-geiser-guile` and connect to the running web server with `M-x geiser-connect` and the port 1970. Now you can not only inspect procedures, but also update any prodedure on the live server using `C-M-x` and get updated output from the webserver! +Next fire up emacs with `emacs-geiser-guile` and connect to the running web server with `M-x geiser-connect` and the port `1970`. Now you can not only inspect procedures, but also update any prodedure on the live server using `C-M-x` and get updated output from the webserver! diff --git a/gn3-guile/web/webserver.scm b/gn3-guile/web/webserver.scm index d2cabf6..6451dc5 100755 --- a/gn3-guile/web/webserver.scm +++ b/gn3-guile/web/webserver.scm @@ -12,6 +12,9 @@ (ice-9 format) (ice-9 iconv) (ice-9 receive) + ;; (ice-9 debugger) + ;; (ice-9 breakpoints) + ;; (ice-9 source) (srfi srfi-1) (srfi srfi-26) (web http) @@ -95,6 +98,13 @@ SELECT DISTINCT ?species WHERE { ;; (define (get-species-uris) ;; (map (lambda (m) (cdr (assoc "value"(cdr (car m))))) (array->list (sparql-species)))) +#! +(define-values (names res) (sparql-species-meta)) +(define table (get-rows names res)) +(define recs '()) +(compile-species recs table) +!# + (define (sparql-species-meta) (sparql-scm " PREFIX gn: <http://genenetwork.org/> @@ -129,13 +139,12 @@ SELECT ?species ?p ?o WHERE { (let* ([s (car r)] [v (cdr (cdr r))] [p (car (cdr r))] - [nrec (assoc s recs)]) ; track records - (if nrec + [nrec (sloppy-assoc s recs)]) ; find record to fill based on subject + (if (nrec) (begin - (display nrec) (set! nrec (assoc-set! nrec p v)) (set! recs (assoc-set! recs s nrec))) - (set! recs (assoc-set! recs s '())) + (set! nrec (assoc-set! nrec s '())) ;; start with empty list ))) rows) recs) |