diff --git a/scribblings/roos.scrbl b/scribblings/roos.scrbl index c059245..01f01d7 100644 --- a/scribblings/roos.scrbl +++ b/scribblings/roos.scrbl @@ -57,6 +57,8 @@ Methods and fields are always virtual. Superclass definitions are resolved based @item{@racket[(roos-id! obj id)] — set object's ID (used in persistence).} ] +@subsection{Provided procedures} + @defproc[(-> [obj any/c] [name symbol?] ...) any/c]{ Invoke a getter, setter, or method on ROOS object @racket[obj] using name and arguments. } @@ -119,7 +121,6 @@ Registers the storage backend for persistent attributes. This must be set before Globally disables or enables deletion via the registered deleter procedure. Useful when shutting down. } - @section{Persistence and Storage Backend} ROOS lets you persist selected attributes by tagging them with @racket[persist]. Persistence is handled by user-provided backends through: @@ -147,9 +148,9 @@ Below is an example SQLite backend implementation that stores fields in a table: (require db) (require racket/vector) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Conversion of field values -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +@;{;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;} +@;{;; Conversion of field values} +@;{;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;} (define (value->string s-expr) (let ((o (open-output-string))) @@ -160,9 +161,9 @@ Below is an example SQLite backend implementation that stores fields in a table: (let ((o (open-input-string str))) (read o))) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Database storage backend -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +@;{;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;} +@;{;; Database storage backend} +@;{;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;} (define conn (sqlite3-connect #:database "roos.db" #:mode 'create)) (query-exec conn "CREATE TABLE IF NOT EXISTS store (class TEXT, id TEXT, field TEXT, val TEXT)") @@ -253,7 +254,7 @@ This example builds an address book with persistent reference to persons, using ) -;; Create sample data +@;{;; Create sample data} (define b (-! book)) (define (adder n t) @@ -269,7 +270,7 @@ This example builds an address book with persistent reference to persons, using (-> b (for-each (lambda (p) (displayln (-> p name))))) -;; Reopen addressbook later from persistent storage +@{;; Reopen addressbook later from persistent storage} (define a (-! book)) (-> b (for-each (lambda (p) (displayln (-> p name)))))