Skip to content
Chris Petersen edited this page Oct 16, 2014 · 1 revision

file->store loads store values from a file.

Parameter Description
name Store name
fname File name to load the store data from

Example

Example 1: Make a store, add some values, save it to file, overwrite and display some values then reload the saved store values from file

> (define store (make-store "mystore"))
> (store-set! store "Color" "Blue")
> (store->file store "./mystore.scm" "Color")
> (store-ref store "Color")
"Blue"
> (store-set! store "Color" "Red")
> (store-ref store "Color")
"Red"
> (file->store store "./mystore.scm")
> (store-ref store "Color")
"Blue"
Clone this wiki locally