Did you know ... Search Documentation:
standard.pl -- XSB Term Writing to Designated I/O Streams
PublicShow source

This module emulates the XSB dedicated term writing predicates from the standard module.

Compatibility
- XSB has a number of additional streams which we do not have. For now we send all messages to user_error. Onlt warning/1 is redirected through SWI-Prolog's print_message/2 interface.
Source error_write(@Term) is det
Source error_writeln(@Term) is det
As write/1 and writeln/1 to user_error.
Source console_write(@Term) is det
Source console_writeln(@Term) is det
As write/1 and writeln/1 to user_error. The XSB version writes to STDFDBK. What does that mean?
Source warning(@Message) is det
Print a warning. The behaviour depends on the flag warning_action, which can be one of:
print_warning
Re-direct the message to SWI-Prolog's print_message
error_warning
Throw error(xsb_warning(Message), _)
silent_warning
Ignore the warning.

If Message is a list or comma-list, the elements are concatenated without a space.

Source message(@Message) is det
Source messageln(@Message) is det
Write message to user_error. As warning/1, Message can be a list or comma list.
Compatibility
- XSB. XSB writes to STDMSG. Possibly we should also redirect this through SWI-Prolog's print_message/2 interface.

Re-exported predicates

The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.

Source error_write(@Term) is det
Source error_writeln(@Term) is det
As write/1 and writeln/1 to user_error.
Source console_write(@Term) is det
Source console_writeln(@Term) is det
As write/1 and writeln/1 to user_error. The XSB version writes to STDFDBK. What does that mean?
Source message(@Message) is det
Source messageln(@Message) is det
Write message to user_error. As warning/1, Message can be a list or comma list.
Compatibility
- XSB. XSB writes to STDMSG. Possibly we should also redirect this through SWI-Prolog's print_message/2 interface.
Source timed_call(:Goal, :Options)
Emulation for XSB timed_call/2. Runs Goal as once/1 with timed interrupts. The interrupt goals are called as interrupts using the semantics of ignore/1: possible choice points are cut and failure is ignored. If the interrupt throws an exception this is propagated.

Options is a list of the terms below. At least one of the terms max/2 or repeating/2 must be present.

max(+MaxInterval, :MaxHandler)
Schedule a single interrupt calling MaxHandler at MaxInterval milliseconds from now.
repeating(+RepInterval, :RepHandler)
Schedule a repeating interrupt calling RepHandler each RepInterval milliseconds.
nesting
Nested calls to timed_call/2 are transformed into calls to once/1. Without nesting, a nested call raises a permission_error exception.
See also
- call_with_time_limit/2, alarm/4, thread_signal/2.
Compatibility
- This predicate is a generalization of the SWI-Prolog library(time) interface. It is left in the XSB emulation because it uses non-standard option syntax and the time is in milliseconds where all SWI-Prolog time handling uses seconds.