OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace commits / 7836d62

Introduce LiteralValueOfLink
7836d62b62eed0a1bfa96db708e5a998c09612ef
by Linas Vepštas <linasvepstas@gmail.com> · 2026-01-22T19:36:07.000Z

Changed files (1) +23 -4

opencog/atoms/atom_types/atom_types.script +23 -4
……@@ -1181,16 +1181,35 @@ TIME_LINK <- FUNCTION_LINK,NUMERIC_OUTPUT_SIG
11811181// However, none of these do anything with free variables, so this
11821182// is both compute and RAM overhead, right? ??
11831183
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.
1193VALUE_OF_LINK <- FUNCTION_LINK
1194
11851195// The BoolValueOf and FloatValueOf links exist only to provide
11861196// 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.
1189VALUE_OF_LINK <- FUNCTION_LINK
1197// the ValueOfLink. These are only marginally useful, but seem needed
1198// in some uncertain special cases.
11901199BOOL_VALUE_OF_LINK <- VALUE_OF_LINK,BOOLEAN_OUTPUT_SIG
11911200FLOAT_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.)
11921207STREAM_VALUE_OF_LINK <- VALUE_OF_LINK,NUMERIC_OUTPUT_SIG
11931208
1209// Return the literal Value located at Key, without executing what
1210// is found, there.
1211LITERAL_VALUE_OF_LINK <- VALUE_OF_LINK
1212
11941213// Return the AtomSpace that the wrapped Atom is in.
11951214ATOM_SPACE_OF_LINK <- VALUE_OF_LINK
11961215