| … | … | @@ -56,7 +56,7 @@ |
| 56 | 56 | |
| 57 | 57 | (define (setup-and-store) |
| 58 | 58 | |
| 59 | | ; Create a stak of five atomspaces. |
| 59 | ; Create a stack of five atomspaces. |
| 60 | 60 | (define base-space (cog-atomspace)) |
| 61 | 61 | (define mid1-space (cog-new-atomspace base-space)) |
| 62 | 62 | (define mid2-space (cog-new-atomspace mid1-space)) |
| … | … | @@ -64,7 +64,7 @@ |
| 64 | 64 | (define surface-space (cog-new-atomspace mid3-space)) |
| 65 | 65 | |
| 66 | 66 | ; Save the entire stack of spaces. This only stores the spaces and |
| 67 | | ; their relationship to one-anothr; it does NOT store the contents, |
| 67 | ; their relationship to one-another; it does NOT store the contents. |
| 68 | 68 | (define storage (RocksStorageNode "rocks:///tmp/frame-demo")) |
| 69 | 69 | (cog-set-value! storage (*-open-*)) |
| 70 | 70 | (cog-set-value! storage (*-store-frames-*) surface-space) |
| … | … | @@ -84,7 +84,7 @@ |
| 84 | 84 | (Predicate "key") (FloatValue 1 0 5)) |
| 85 | 85 | (cog-set-value! storage (*-store-atom-*) (ListLink (Concept "foo") (Concept "bar"))) |
| 86 | 86 | |
| 87 | | ; Change the ctv on `foo`. This will hade the earlier value. |
| 87 | ; Change the value on `foo`. This will hide the earlier value. |
| 88 | 88 | (cog-set-atomspace! mid3-space) |
| 89 | 89 | (cog-set-value! (Concept "foo") (Predicate "key") (FloatValue 6 22 42)) |
| 90 | 90 | (cog-set-value! storage (*-store-atom-*) (Concept "foo")) |
| … | … | @@ -117,11 +117,11 @@ |
| 117 | 117 | (cog-set-value! storage (*-open-*)) |
| 118 | 118 | |
| 119 | 119 | ; Calling `load-frames` will return a list of all of the AtomSpaces |
| 120 | | ; at the top of the DAG of frames. In this cae, we had a simple stack, |
| 120 | ; at the top of the DAG of frames. In this case, we had a simple stack, |
| 121 | 121 | ; so there is only one single frame at the top, the top-space. |
| 122 | 122 | (define top-space (cog-value-ref (cog-value storage (*-load-frames-*)) 0)) |
| 123 | 123 | |
| 124 | | ; Change to this top, and load it's contents, and everything below it. |
| 124 | ; Change to this top, and load its contents, and everything below it. |
| 125 | 125 | (cog-set-atomspace! top-space) |
| 126 | 126 | (cog-set-value! storage (*-load-atomspace-*) (cog-atomspace)) |
| 127 | 127 | (cog-set-value! storage (*-close-*)) |