| … | … | @@ -70,7 +70,13 @@ ValuePtr PureExecLink::execute(AtomSpace* as, |
| 70 | 70 | if (h->is_type(ATOM_SPACE)) |
| 71 | 71 | { |
| 72 | 72 | ctxt = AtomSpaceCast(h).get(); |
| 73 | | vseq.push_back(h); // Record it too, for posterity. |
| 73 | // Well, we could "record it for posterity", but if the |
| 74 | // user only wanted to do one thing and get the result, |
| 75 | // this extra labelling just gets in the way. Worse, the |
| 76 | // user would almost surely discard this label, anyway. |
| 77 | // If they really really need this info, they can get it |
| 78 | // in other ways. |
| 79 | // vseq.push_back(h); // Record it, for posterity. |
| 74 | 80 | continue; |
| 75 | 81 | } |
| 76 | 82 | if (not h->is_executable()) |
| … | … | @@ -96,14 +102,24 @@ ValuePtr PureExecLink::execute(AtomSpace* as, |
| 96 | 102 | // Special case. New context. |
| 97 | 103 | if (vp->is_type(ATOM_SPACE)) |
| 98 | 104 | ctxt = AtomSpaceCast(vp).get(); |
| 99 | | |
| 100 | | vseq.emplace_back(vp); |
| 105 | else |
| 106 | vseq.emplace_back(vp); |
| 101 | 107 | |
| 102 | 108 | // If we are using a scratch space, clear it. |
| 103 | 109 | if (scratch.get() == ctxt) |
| 104 | 110 | scratch->clear(); |
| 105 | 111 | } |
| 106 | 112 | |
| 113 | // Sop to the user. If only one item, return that one item. |
| 114 | // This feels both hacky, and also reasonable. The hacky |
| 115 | // feeling is that it behaves differently, based on size. Yuck. |
| 116 | // But its also natural, as why should we wrap just one thing? |
| 117 | // This would force the user to unwrap, adding complexity to |
| 118 | // processing pipelines. The user just wanted to "do just one |
| 119 | // thing", and we did it; the extra gift-wrapping is just junk. |
| 120 | if (1 == vseq.size()) |
| 121 | return vseq[0]; |
| 122 | |
| 107 | 123 | return createLinkValue(std::move(vseq)); |
| 108 | 124 | } |
| 109 | 125 | |