1:- module(tidylog, [ codes_term/2
    2                   , variable_name/2
    3                   ]).    4
    5:- use_module(library(tidylog/dcg)).    6
    7
    8% avoid "Undefined procedure" errors
    9attr_unify_hook(_,_).
 codes_term(+Codes, -Term) is det
codes_term(-Codes, +Term) is det
True if Term can be read from Codes. All characters of Codes must be consumed.
   16codes_term(Codes, Term) :-
   17    nonvar(Codes),
   18    !,
   19    once(phrase(read_prolog(Term),Codes)).
   20codes_term(Codes,Term) :-
   21    once(phrase(write_prolog(Term),Codes)).
 variable_name(-Var, -Name:atom) is det
True if Var was named Name in the original source code. Throws an exception if Var was not created by tidylog parsing source code.
   30variable_name(Var,Name) :-
   31    must_be(var, Var),
   32    once( get_attr(Var, tidylog, name(Name))
   33        ; throw("Variable not created by tidylog")
   34        )