| … | … | @@ -253,10 +253,25 @@ public: |
| 253 | 253 | |
| 254 | 254 | /** |
| 255 | 255 | * Add an atom to the Atom Table. If the atom already exists |
| 256 | | * then that is returned. |
| 256 | * then that is returned. If this AtomSpace is stacked on top |
| 257 | * of others, then the shallowest copy of an existing Atom will |
| 258 | * be returrned. |
| 257 | 259 | */ |
| 258 | 260 | Handle add_atom(const Handle&); |
| 259 | 261 | |
| 262 | /** |
| 263 | * Add an atom to the Atom Table. If the atom already exists |
| 264 | * then that is returned. It is force-added to this AtomSpace, |
| 265 | * even if a version of this same Atom exists deeper in the |
| 266 | * AtomSpace stack. This is conventionally used to guarantee |
| 267 | * that execution happens in scratch AtomSpaces. |
| 268 | */ |
| 269 | Handle localize(const Handle& h) |
| 270 | { |
| 271 | if (h->getAtomSpace() == this) return h; |
| 272 | return add(h, true); // force copy |
| 273 | } |
| 274 | |
| 260 | 275 | /** |
| 261 | 276 | * Add a node to the Atom Table. If the atom already exists |
| 262 | 277 | * then that is returned. |