Logtalk reference manual
Glossary
contents

# Reference Manual

## Grammar

Compilation units
  Object definition
  Category definition
  Protocol definition

Entity relations
  Implemented protocols
  Extended protocols
  Imported categories
  Extended objects
  Extended categories
  Instantiated objects
  Specialized objects
  Complemented objects
  Entity scope

Entity identifiers
  Object identifiers
  Category identifiers
  Protocol identifiers

Source file names

Directives
  Source file directives
  Conditional compilation directives
  Object directives
  Category directives
  Protocol directives
  Predicate directives

Clauses and goals

Lambda expressions

Entity properties

Predicate properties

## Directives

### Source file directives

`encoding/1`
`include/1`
`initialization/1`
`op/3`
`set_logtalk_flag/2`

### Conditional compilation directives

`if/1`
`elif/1`
`else/0`
`endif/0`

### Entity directives

`built_in/0`
`category/1-3`
`dynamic/0`
`end_category/0`
`end_object/0`
`end_protocol/0`
`include/1`
`info/1`
`initialization/1`
`object/1-5`
`op/3`
`protocol/1-2`
`set_logtalk_flag/2`
`threaded/0`

### Predicate directives

`alias/2`
`coinductive/1`
`discontiguous/1`
`dynamic/1`
`info/2`
`meta_predicate/1`
`meta_non_terminal/1`
`mode/2`
`multifile/1`
`op/3`
`private/1`
`protected/1`
`public/1`
`synchronized/1`
`uses/2`

`use_module/2`

## Built-in predicates

### Enumerating objects, categories and protocols

`current_category/1`
`current_object/1`
`current_protocol/1`

### Enumerating objects, categories and protocols properties

`category_property/2`
`object_property/2`
`protocol_property/2`

### Creating new objects, categories and protocols

`create_category/4`
`create_object/4`
`create_protocol/3`

### Abolishing objects, categories and protocols

`abolish_category/1`
`abolish_object/1`
`abolish_protocol/1`

### Objects, categories and protocols relations

`extends_object/2-3`
`extends_protocol/2-3`
`extends_category/2-3`

`implements_protocol/2-3`
`conforms_to_protocol/2-3`

`imports_category/2-3`

`instantiates_class/2-3`
`specializes_class/2-3`

`complements_object/2`

### Event handling

`abolish_events/5`
`current_event/5`
`define_events/5`

### Multi-threading meta-predicates

`threaded/1`

`threaded_call/1-2`
`threaded_once/1-2`
`threaded_ignore/1`

`threaded_exit/1-2`
`threaded_peek/1-2`

`threaded_wait/1`
`threaded_notify/1`

### Compiling and loading objects, categories and protocols

`logtalk_compile/1`
`logtalk_compile/2`
`logtalk_load/1`
`logtalk_load/2`
`logtalk_make/0`
`logtalk_make/1`
`logtalk_library_path/2`
`logtalk_load_context/2`

### Flags

`current_logtalk_flag/2`
`set_logtalk_flag/2`
`create_logtalk_flag/3`

## Built-in methods

### Execution context methods

`parameter/2`
`self/1`
`sender/1`
`this/1`

### Reflection methods

`current_op/3`
`current_predicate/1`
`predicate_property/2`

### Database methods

`abolish/1`
`asserta/1`
`assertz/1`
`clause/2`
`retract/1`
`retractall/1`

### Meta-call methods

`call/1-N`
`ignore/1`
`once/1`
`\+/1`

### Exception-handling methods

`catch/3`
`throw/1`

### All solutions methods

`bagof/3`
`findall/3`
`findall/4`
`forall/2`
`setof/3`

### Event handler methods

`before/3`
`after/3`

### Message forwarding methods

`forward/1`

### DCGs non-terminals and parsing methods

`call//1-N`
`phrase//1`
`phrase/2`
`phrase/3`

### Term and goal expansion methods

`expand_term/2`
`term_expansion/2`
`expand_goal/2`
`goal_expansion/2`

### Coinduction hook predicates

`coinductive_success_hook/1-2`

## Control constructs

### Message sending

`::/2`
`::/1`

### Message delegation

`[]/1`

### Calling imported and inherited predicate definitions

`^^/1`

### Calling external code

`{}/1`

### Context-switching calls

`<</2`

## Methods provided by the `logtalk` built-in object

### Message printing methods

`print_message/3`
`message_tokens//2`
`message_hook/4`
`message_prefix_stream/4`
`print_message_tokens/3`
`print_message_token/4`

### Question asking methods

`ask_question/5`
`question_hook/5`
`question_prompt_stream/4`