Welcome to the CHICKEN Scheme pasting service

more module issues added by rien on Fri Nov 22 20:58:54 2013



(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:

	<syntax>	  (##core#lambda (title) (insert query:new-note-with-title title) (insert query:new-note-fti (last-id)...
	<syntax>	  [new-note] (##core#begin (insert query:new-note-with-title title) (insert query:new-note-fti (last-id) title))
	<syntax>	  [new-note] (insert query:new-note-with-title title)
	<syntax>	  [new-note] (insert query:new-note-fti (last-id) title)
	<syntax>	  [new-note] (last-id)
	<syntax>	  (define (match-words s) (regex:split-string-fields "[a-z]+" s))
	<syntax>	  (##core#set! match-words (##core#lambda (s) (regex:split-string-fields "[a-z]+" s)))
	<syntax>	  (##core#lambda (s) (regex:split-string-fields "[a-z]+" s))
	<syntax>	  [match-words] (##core#begin (regex:split-string-fields "[a-z]+" s))
	<syntax>	  [match-words] (regex:split-string-fields "[a-z]+" s)
	<syntax>	  (define (commafy-tokens tokens) (string-join (string-split tokens " ") ","))
	<syntax>	  (##core#set! commafy-tokens (##core#lambda (tokens) (string-join (string-split tokens " ") ",")))
	<syntax>	  (##core#lambda (tokens) (string-join (string-split tokens " ") ","))
	<syntax>	  [commafy-tokens] (##core#begin (string-join (string-split tokens " ") ","))
	<syntax>	  [commafy-tokens] (string-join (string-split tokens " ") ",")
	<syntax>	  [commafy-tokens] (string-split tokens " ")	<--
|#

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What is the operator to construct pairs?
Visually impaired? Let me spell it for you (wav file) download WAV