| … | … | @@ -1181,16 +1181,35 @@ TIME_LINK <- FUNCTION_LINK,NUMERIC_OUTPUT_SIG |
| 1181 | 1181 | // However, none of these do anything with free variables, so this |
| 1182 | 1182 | // is both compute and RAM overhead, right? ?? |
| 1183 | 1183 | |
| 1184 | | // Return the indicated Value on the indicated Atom. |
| 1184 | // Locate the Value attached at Key on Atom. If the Value is executable, |
| 1185 | // then execute it, and return that. This kind of eager execution allows |
| 1186 | // chaining of function calls. For example, consider (Plus 2 (ValueOf..)) |
| 1187 | // where the literal value at the key is some function. If ValueOf |
| 1188 | // returned returned the literal value, then Plus would need to run the |
| 1189 | // execute twice: once on ValueOf, and again on whatever was returned. |
| 1190 | // Even then, twice might not be enough... Thus, the design point is to |
| 1191 | // have ValueOf not just "fetch the contents", but actually run them. |
| 1192 | // If you want the literal value without execution, use LiterlValueOf. |
| 1193 | VALUE_OF_LINK <- FUNCTION_LINK |
| 1194 | |
| 1185 | 1195 | // The BoolValueOf and FloatValueOf links exist only to provide |
| 1186 | 1196 | // creation-time type checking; otherwise, they behave just like |
| 1187 | | // the ValueOfLink. The StreamValueOf can return non-number streams, |
| 1188 | | // but we lie about this to keep the static typechecker happy. |
| 1189 | | VALUE_OF_LINK <- FUNCTION_LINK |
| 1197 | // the ValueOfLink. These are only marginally useful, but seem needed |
| 1198 | // in some uncertain special cases. |
| 1190 | 1199 | BOOL_VALUE_OF_LINK <- VALUE_OF_LINK,BOOLEAN_OUTPUT_SIG |
| 1191 | 1200 | FLOAT_VALUE_OF_LINK <- VALUE_OF_LINK,NUMERIC_OUTPUT_SIG |
| 1201 | |
| 1202 | // The StreamValueOf returns one item at a time. That is, it treats |
| 1203 | // its input as a queue or set, handing out one at a time. See the |
| 1204 | // DesignNotes-A.md for discussion. |
| 1205 | // It can return non-number streams, but we lie about this to keep |
| 1206 | // the static typechecker happy. (Because most streams are numeric.) |
| 1192 | 1207 | STREAM_VALUE_OF_LINK <- VALUE_OF_LINK,NUMERIC_OUTPUT_SIG |
| 1193 | 1208 | |
| 1209 | // Return the literal Value located at Key, without executing what |
| 1210 | // is found, there. |
| 1211 | LITERAL_VALUE_OF_LINK <- VALUE_OF_LINK |
| 1212 | |
| 1194 | 1213 | // Return the AtomSpace that the wrapped Atom is in. |
| 1195 | 1214 | ATOM_SPACE_OF_LINK <- VALUE_OF_LINK |
| 1196 | 1215 | |