(module tagnotes () (import scheme chicken) (use srfi-1 srfi-13 (prefix sql-de-lite sql:) (prefix regex regex:) (prefix queries query:) global) ;; make-title "title" -> "title" ;; make-title "" -> "untitled" (define (make-title title) (if (string=? title "") "untitled" title)) (define (last-id) (sql:last-insert-rowid *db*)) (define (insert insert-query . args) (let ((stmt (sql:sql *db* insert-query))) (apply sql:exec (cons stmt args)))) (define (new-note title) (insert query:new-note-with-title title) (insert query:new-note-fti (last-id) title)) (define (match-words s) (regex:split-string-fields "[a-z]+" s)) (define (commafy-tokens tokens) (string-join (string-split tokens " ") ",")) #;(define (search token-string) (let ((comma-tokens (commafy-tokens token-string))) )) ) #| Warning: reference to possibly unbound identifier `string-split' in: Warning: commafy-tokens Warning: reference to possibly unbound identifier `regex:split-string-fields' in: Warning: match-words Warning: reference to possibly unbound identifier `*db*' in: Warning: insert Warning: last-id Error: module unresolved: tagnotes Call history: (##core#lambda (title) (insert query:new-note-with-title title) (insert query:new-note-fti (last-id)... [new-note] (##core#begin (insert query:new-note-with-title title) (insert query:new-note-fti (last-id) title)) [new-note] (insert query:new-note-with-title title) [new-note] (insert query:new-note-fti (last-id) title) [new-note] (last-id) (define (match-words s) (regex:split-string-fields "[a-z]+" s)) (##core#set! match-words (##core#lambda (s) (regex:split-string-fields "[a-z]+" s))) (##core#lambda (s) (regex:split-string-fields "[a-z]+" s)) [match-words] (##core#begin (regex:split-string-fields "[a-z]+" s)) [match-words] (regex:split-string-fields "[a-z]+" s) (define (commafy-tokens tokens) (string-join (string-split tokens " ") ",")) (##core#set! commafy-tokens (##core#lambda (tokens) (string-join (string-split tokens " ") ","))) (##core#lambda (tokens) (string-join (string-split tokens " ") ",")) [commafy-tokens] (##core#begin (string-join (string-split tokens " ") ",")) [commafy-tokens] (string-join (string-split tokens " ") ",") [commafy-tokens] (string-split tokens " ") <-- |#