object
logtalk¶
Built-in object providing message printing, debugging, library, source file, and hacking methods.
static, built_in, context_switching_calls, threaded(no dependencies on other entities)
Public interface¶
print_message/3¶
Prints a message of the given kind for the specified component.
staticprint_message(Kind,Component,Message)print_message(+nonvar,+nonvar,+nonvar) - oneprint_message_tokens/3¶
Print the messages tokens to the given stream, prefixing each line with the specified atom.
staticprint_message_tokens(Stream,Prefix,Tokens)print_message_tokens(@stream_or_alias,+atom,@list(nonvar)) - oneprint_message_token/4¶
User-defined hook predicate for printing a message token (at_same_line, nl, flush, Format-Arguments, term(Term,Options), ansi(Attributes,Format,Arguments), begin(Kind,Variable), and end(Variable)).
dynamic, multifileprint_message_token(Stream,Prefix,Token,Tokens)print_message_token(@stream_or_alias,@atom,@nonvar,@list(nonvar)) - zero_or_onemessage_tokens//2¶
User-defined hook grammar rule for converting a message into a list of tokens (at_same_line, nl, flush, Format-Arguments, term(Term,Options), ansi(Attributes,Format,Arguments), begin(Kind,Variable), and end(Variable)).
dynamic, multifilemessage_tokens(Message,Component)message_prefix_stream/4¶
Message line prefix and output stream to be used when printing a message given its kind and component.
dynamic, multifilemessage_prefix_stream(Kind,Component,Prefix,Stream)message_prefix_stream(?nonvar,?nonvar,?atom,?stream_or_alias) - zero_or_moremessage_hook/4¶
User-defined hook predicate for intercepting message printing calls.
dynamic, multifilemessage_hook(Message,Kind,Component,Tokens)message_hook(+nonvar,+nonvar,+nonvar,+list(nonvar)) - zero_or_oneask_question/5¶
Asks a question and reads the answer until the check predicate is true.
staticask_question(Kind,Component,Question,Check,Answer)ask_question(*,*,*,1,*)ask_question(+nonvar,+nonvar,+nonvar,+callable,-term) - onequestion_hook/6¶
User-defined hook predicate for intercepting question asking calls.
dynamic, multifilequestion_hook(Question,Kind,Component,Tokens,Check,Answer)question_hook(*,*,*,*,1,*)question_hook(+nonvar,+nonvar,+nonvar,+list(nonvar),+callable,-term) - zero_or_onequestion_prompt_stream/4¶
Prompt and input stream to be used when asking a question given its kind and component.
dynamic, multifilequestion_prompt_stream(Kind,Component,Prompt,Stream)question_prompt_stream(?nonvar,?nonvar,?atom,?stream_or_alias) - zero_or_moretrace_event/2¶
Trace event handler. The runtime calls all trace event handlers using a failure-driven loop before calling the debug event handler.
dynamic, multifiletrace_event(Event,ExecutionContext)trace_event(@callable,@execution_context) - zerodebug_handler_provider/1¶
Declares an object as the debug handler provider. There should be at most one debug handler provider loaded at any given moment.
static, multifiledebug_handler_provider(Provider)debug_handler_provider(?object_identifier) - zero_or_onedebug_handler/2¶
Debug event handler. The defined events are unification events - fact(Entity,Fact,Clause,File,Line) and rule(Entity,Head,Clause,File,Line) - and goal events - top_goal(Goal,CompiledGoal) and goal(Goal,CompiledGoal).
static, multifiledebug_handler(Event,ExecutionContext)debug_handler(?entity_identifier,?atom) - zero_or_moreexpand_library_path/2¶
Expands a library alias or a library path into its absolute path. Uses a depth bound to prevent loops.
staticexpand_library_path(LibraryPath,AbsolutePath)expand_library_path(+atom,?atom) - zero_or_oneexpand_library_path(+callable,?atom) - zero_or_oneloaded_file/1¶
Enumerates, by backtracking, all loaded files, returning their full paths.
staticloaded_file(Path)loaded_file(?atom) - zero_or_moreloaded_file_property/2¶
Enumerates, by backtracking, all loaded file properties. Valid properties are: basename/1, directory/1, mode/1, flags/1, text_properties/1 (encoding/1 and bom/1), target/1, modified/1, parent/1, includes/1, library/1, object/1, protocol/1, and category/1.
staticloaded_file_property(Path,Property)loaded_file_property(?atom,?compound) - zero_or_morefile_type_extension/2¶
Enumerates, by backtracking, all defined file type extensions. The defined types are: source, object, logtalk, prolog, and tmp. The source type returns both logtalk and prolog type extensions.
staticfile_type_extension(Type,Extension)file_type_extension(?atom,?atom) - zero_or_morecompile_aux_clauses/1¶
Compiles a list of auxiliary clauses. Can only be called during source file compilation, usually from term_expansion/2 or goal_expansion/2 hook predicate definitions.
staticcompile_aux_clauses(Clauses)compile_aux_clauses(@list(clause)) - oneentity_prefix/2¶
Converts between an entity identifier and the entity prefix that is used for its compiled code. When none of the arguments is instantiated, it returns the identifier and the prefix of the entity under compilation, if any.
staticentity_prefix(Entity,Prefix)entity_prefix(?entity_identifier,?atom) - zero_or_onecompile_predicate_heads/4¶
Compiles clause heads. The heads are compiled in the context of the entity under compilation when the entity argument is not instantiated.
staticcompile_predicate_heads(Heads,Entity,CompiledHeads,ExecutionContext)compile_predicate_heads(@list(callable),?entity_identifier,-list(callable),@execution_context) - zero_or_onecompile_predicate_heads(@conjunction(callable),?entity_identifier,-conjunction(callable),@execution_context) - zero_or_onecompile_predicate_heads(@callable,?entity_identifier,-callable,@execution_context) - zero_or_onecompile_predicate_indicators/3¶
Compiles predicate indicators. The predicate are compiled in the context of the entity under compilation when the entity argument is not instantiated.
staticcompile_predicate_indicators(PredicateIndicators,Entity,CompiledPredicateIndicators)compile_predicate_indicators(@list(predicate_indicator),?entity_identifier,-list(predicate_indicator)) - zero_or_onecompile_predicate_indicators(@conjunction(predicate_indicator),?entity_identifier,-conjunction(predicate_indicator)) - zero_or_onecompile_predicate_indicators(@predicate_indicator,?entity_identifier,-predicate_indicator) - zero_or_onedecompile_predicate_heads/4¶
Decompiles clause heads. All compiled clause heads must belong to the same entity, which must be loaded.
staticdecompile_predicate_heads(CompiledHeads,Entity,Type,Heads)decompile_predicate_heads(@list(callable),-entity_identifier,-atom,-list(callable)) - zero_or_onedecompile_predicate_heads(@conjunction(callable),-entity_identifier,-atom,-conjunction(callable)) - zero_or_onedecompile_predicate_heads(@callable,-entity_identifier,-atom,-callable) - zero_or_onedecompile_predicate_indicators/4¶
Decompiles predicate indicators. All compiled predicate indicators must belong to the same entity, which must be loaded.
staticdecompile_predicate_indicators(CompiledPredicateIndicators,Entity,Type,PredicateIndicators)decompile_predicate_indicators(@list(predicate_indicator),-entity_identifier,-atom,-list(predicate_indicator)) - zero_or_onedecompile_predicate_indicators(@conjunction(predicate_indicator),-entity_identifier,-atom,-conjunction(predicate_indicator)) - zero_or_onedecompile_predicate_indicators(@predicate_indicator,-entity_identifier,-atom,-predicate_indicator) - zero_or_oneexecution_context/7¶
Execution context term data. Execution context terms should be considered opaque terms subject to change without notice.
staticexecution_context(ExecutionContext,Entity,Sender,This,Self,MetaCallContext,CoinductionStack)execution_context(?nonvar,?entity_identifier,?object_identifier,?object_identifier,?object_identifier,@list(callable),@list(callable)) - zero_or_oneProtected interface¶
(none)
Private predicates¶
(none)
Operators¶
(none)
Remarks¶
Message kinds: The default set is {silent, silent(Category), banner, help, comment, comment(Category), information, information(Category), warning, warning(Category), error, error(Category), debug, debug(Category), question, question(Category)}.
Printing of silent messages: By default, silent messages are not printed. These messages are only useful when intercepted.
Printing of banner and comment messages: By default, banner and comment messages are only printed when the report flag is turned on.
Printing of help, information, and question messages: These messages are always printed by default as they provide requested output.
Printing of warning messages: By default, warning messages are not printed when the report flag is turned off.
Printing of error messages: These messages are always printed by default.
Printing of debug messages: By default, debug messages are only printed when the debug flag is turned on.
Meta messages: A meta message is a message that have another message as argument and is typically used for debugging messages. Meta messages avoid the need of defining tokenizer rules for every message but can be intercepted as any other message.
@Message meta message: By default, the message is printed as passed to the write/1 predicate followed by a newline.
Key-Value meta message: By default, the message is printed as “Key: Value” followed by a newline. The value is printed as passed to the writeq/1 predicate.
List meta message: By default, the list items are printed indented one per line. The items are preceded by a dash and printed as passed to the writeq/1 predicate.
Title::List meta message: By default, the title is printed followed by a newline and the indented list items, one per line. The items are preceded by a dash and printed as passed to the writeq/1 predicate.