View source with raw comments or as raw
    1/*  Part of SWI-Prolog
    2
    3    Author:        Jan Wielemaker
    4    E-mail:        J.Wielemaker@vu.nl
    5    WWW:           http://www.swi-prolog.org
    6    Copyright (c)  1999-2019, University of Amsterdam
    7                              VU University Amsterdam
    8                              CWI, Amsterdam
    9    All rights reserved.
   10
   11    Redistribution and use in source and binary forms, with or without
   12    modification, are permitted provided that the following conditions
   13    are met:
   14
   15    1. Redistributions of source code must retain the above copyright
   16       notice, this list of conditions and the following disclaimer.
   17
   18    2. Redistributions in binary form must reproduce the above copyright
   19       notice, this list of conditions and the following disclaimer in
   20       the documentation and/or other materials provided with the
   21       distribution.
   22
   23    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   24    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   25    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
   26    FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
   27    COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
   28    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
   29    BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   30    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   31    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   32    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
   33    ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   34    POSSIBILITY OF SUCH DAMAGE.
   35*/
   36
   37:- module(edinburgh,
   38          [ display/1,
   39            display/2,
   40            unknown/2,
   41            reconsult/1,
   42            debug/0,
   43            nodebug/0,
   44            fileerrors/2
   45          ]).   46
   47:- meta_predicate
   48    unknown(:, :),
   49    reconsult(:).

Some traditional Edinburgh predicates

This module defines predicates from `traditional Edinburgh Prolog' (Dec10 and C-Prolog) whose functionality has been replaced by (ISO) Standard Prolog. */

   59                 /*******************************
   60                 *            TERM I/O          *
   61                 *******************************/
 display(+Term) is det
 display(+Stream, +Term) is det
Write a term, ignoring operators and special syntax constructs such as brace terms ({a}) and lists ([a,b,c]). Currently does print dicts using the dict notation.
See also
- write_canonical/2. SWI-Prolog's write_canonical/2, however, prints lists using lst notation to reduce incompatibility due to the modified list functor ('[|]' rather than `.`) and reduce memory usage while parsing lists.
   75display(Term) :-
   76    display(current_output, Term).
   77display(Stream, Term) :-
   78    write_term(Stream, Term,
   79               [ quoted(true),
   80                 ignore_ops(true),
   81                 no_lists(true),
   82                 brace_terms(true)
   83               ]).
 unknown(-Old, +New) is det
Edinburgh Prolog predicate for dealing dealing with undefined procedures
   90unknown(M:Old, M:New) :-
   91    current_prolog_flag(M:unknown, O),
   92    map_unknown(O, Old),
   93    map_unknown(N, New),
   94    !,
   95    set_prolog_flag(M:unknown, N).
   96
   97map_unknown(error,   trace).
   98map_unknown(warning, trace).
   99map_unknown(fail,    fail).
 reconsult(+FileOrList) is det
Load source file(s), wiping the old content first. SWI-Prolog's consult/1 and related predicates always do this.
deprecated
- The Edinburgh Prolog consult/reconsult distinction is no longer used throughout most of the Prolog world.
  109reconsult(File) :-
  110    consult(File).
 debug is det
 nodebug is det
Switch on/off debug mode. Note that nodebug/0 has been defined such that is is not traced itself.
  118debug   :- set_prolog_flag(debug, true).
  119nodebug :- notrace, set_prolog_flag(debug, false).
  120
  121:- '$hide'(nodebug/0).
 fileerrors(-Old, +New) is det
Query and change the fileerrors flag. Default it is set to true, causing file operations to raise an exception. Setting it to false activates the old Edinburgh mode of silent failure.
deprecated
- New code should use catch/3 to handle file errors silently
  133fileerrors(Old, New) :-
  134    current_prolog_flag(fileerrors, Old),
  135    (   Old == New
  136    ->  true
  137    ;   set_prolog_flag(fileerrors, New)
  138    )