Expand description
Term-introspection builtins: functor/3, arg/3, =../2 (univ),
copy_term/2.
Tag decisions:
functor(T, '.', 2)andT =.. ['.', a, b]both build a STR (functor “.”, arity 2), NOT a list cell.- decomposing a
TAG_LSTyields functor./ arity 2 and args [Head, Tail] (univ produces['.', H, T]). - errors are structured balls (see the captured strings in the unit tests).
Functions§
- plg_
rt_ b_ arg_ 3 arg/3: the N-th argument of a compound. 1 = success, 0 = fail/error.- plg_
rt_ b_ copy_ term_ 2 copy_term/2: a fresh copy oforigwith consistent renamed vars.- plg_
rt_ b_ functor_ 3 functor/3: decompose or construct. 1 = success, 0 = failure/error.- plg_
rt_ b_ univ_ 2 =../2(univ): decompose into / build from a list. 1 = success.