| … | … | @@ -31,9 +31,22 @@ namespace opencog |
| 31 | 31 | * @{ |
| 32 | 32 | */ |
| 33 | 33 | |
| 34 | | /// The ValueOfLink returns the value on the indicated atom (first |
| 35 | | /// argument) at the indicated key (second argument). |
| 34 | /// The ValueOfLink obtains the Value on the indicated Atom (first |
| 35 | /// argument) at the indicated key (second argument). If that Value is |
| 36 | /// an executable Atom, then it is executed, and the result returned. |
| 36 | 37 | /// |
| 38 | /// This design allows ValueOf to be used in constructing execution |
| 39 | /// chains that run automatically. Consider, for example, |
| 40 | /// |
| 41 | /// (Plus (Number 2) (ValueOf (Anchor "foo") (Predicate "bar"))) |
| 42 | /// |
| 43 | /// Suppose that the Value at foo-bar was a function definition; of |
| 44 | /// course, this would need to be run, before the Plus could be |
| 45 | /// performed. That function might be another ValueOf ... ad infinitum. |
| 46 | /// The ValueOfLink performs all of that unwrapping, delivering the |
| 47 | /// final result. |
| 48 | /// |
| 49 | /// Use LiteralValueOf to get the unexecuted literal Value. |
| 37 | 50 | class ValueOfLink : public FunctionLink |
| 38 | 51 | { |
| 39 | 52 | private: |