OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace commits / 2d996e0

Localize atoms during execution
2d996e0bda3916f2c5daf6c31214370fade6dd70
by Linas Vepštas <linasvepstas@gmail.com> · 2026-01-22T01:55:36.000Z

Changed files (2) +8 -4

opencog/atoms/flow/LinkSignatureLink.cc +7 -3
……@@ -183,13 +183,17 @@ ValuePtr LinkSignatureLink::execute(AtomSpace* as, bool silent)
183183 // The _kind will usually be some LinkValue. One interesting
184184 // case is the stream, which takes some Handle argument that
185185 // controls the stream operation. Examples include SortedStream
186 // and FlatStream. Pass that directly to the correct factory.
186 // and FlatStream. Those Handles are given directly to the Value
187 // factory. In order to work correctly for scratch spaces, these
188 // Atoms have to be localized to this space.
187189 if (nameserver().isA(_kind, HANDLE_ARG) and 2 == _outgoing.size())
188 return valueserver().create(_kind, _outgoing[1]);
190 return valueserver().create(_kind, as->localize(_outgoing[1]));
189191
190192 if (nameserver().isA(_kind, HANDLE_VEC_ARG) and 1 < _outgoing.size())
191193 {
192 HandleSeq rest(_outgoing.begin() + 1, _outgoing.end());
194 HandleSeq rest;
195 for (size_t i=1; i<_outgoing.size(); i++)
196 rest.emplace_back(as->localize(_outgoing[i]));
193197 return valueserver().create(_kind, std::move(rest));
194198 }
195199
opencog/atoms/value/SortedValue.cc +1 -1
……@@ -44,7 +44,7 @@ SortedValue::SortedValue(const HandleSeq& hs)
4444 init_src(hs[1]);
4545}
4646
47// Same as above, but the two arguments arive in a ValueSeq.
47// Same as above, but the two arguments arrive in a ValueSeq.
4848// Ideally, the factory *should* have given us a pair of Handles,
4949// but twiddling this is a hassle, so not doing that right now.
5050// XXX FIXME maybe fix the factory, some day.