OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace commits / ac085a8

Add method to force-localize a copy of an Atom
ac085a80f996d17f83436f3bef3d7f1c34f0e2d0
by Linas Vepštas <linasvepstas@gmail.com> · 2026-01-22T01:40:09.000Z

Changed files (1) +16 -1

opencog/atomspace/AtomSpace.h +16 -1
……@@ -253,10 +253,25 @@ public:
253253
254254 /**
255255 * 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.
257259 */
258260 Handle add_atom(const Handle&);
259261
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
260275 /**
261276 * Add a node to the Atom Table. If the atom already exists
262277 * then that is returned.