From f658a384320806e0591a3ce54a400fd1b18f83a7 Mon Sep 17 00:00:00 2001 From: AdrickTench Date: Wed, 18 Dec 2024 16:36:18 -0600 Subject: [PATCH] doc for type-check symbol --- prolog/metta_lang/stdlib_mettalog.metta | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/prolog/metta_lang/stdlib_mettalog.metta b/prolog/metta_lang/stdlib_mettalog.metta index 3bfb94a1a9..45bb95eb2b 100644 --- a/prolog/metta_lang/stdlib_mettalog.metta +++ b/prolog/metta_lang/stdlib_mettalog.metta @@ -97,8 +97,11 @@ (= (If False $then) (let $n 0 (let $n 1 $n))) (= (If $cond $then $else) (if $cond $then $else)) -(iz predicate-arity MeTTaLog) +(@doc type-check + (@desc "The value of type-check determines MeTTa's type-checking behavior. Set via pragma!. When set to auto (i.e. !(pragma! type-check auto)), types are checked immediately on adding an expression to the space. By default, when unset (or set to anything other than auto), types are checked only on evaluation. For example !(+ 1 \"2\") would trigger a type violation, but (= (foo $x) (+ $x \"2\")) would not, unless type-check is set to auto, in which case both would trigger type violations.")) +(: type-check Symbol) +(iz predicate-arity MeTTaLog) (@doc predicate-arity (@desc "Specifies the arity (number of arguments) for a given predicate, allowing it to be queriable in the system's match framework. This is particularly useful for enabling built-in functions, such as `size-atom`, to be used as predicates in declarative contexts and run in reverse to compute inputs based on outputs.