This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/pl/protect.yap

59 lines
1.9 KiB
Plaintext
Raw Normal View History

2015-09-21 23:05:36 +01:00
xc/*************************************************************************
* *
* YAP Prolog *
* *
* Yap Prolog was developed at NCCUP - Universidade do Porto *
* *
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
* *
**************************************************************************
* *
* File: protect.yap *
* Last rev: *
* mods: *
* comments: protecting the system functions *
* *
*************************************************************************/
2014-04-09 12:39:29 +01:00
:- system_module( '$_protect', [], ['$protect'/0]).
% This protects all code from further changes
% and also makes it impossible from some predicates to be seen
'$protect' :-
current_atom(Name),
2016-01-03 02:06:09 +00:00
sub_atom(Name,0,1,_, '$'),
'$hide'(Name),
fail.
'$protect' :-
2016-01-03 02:06:09 +00:00
'$all_current_modules'(M),
M \= user,
'$current_predicate'(_,M,P,_),
functor(P,N,A),
'$new_system_predicate'(N,A,M),
% writeln(N/A),
fail.
'$protect'.
% hide all atoms who start by '$'
'$hide'('$VAR') :- !, fail. /* not $VAR */
'$hide'('$dbref') :- !, fail. /* not stream position */
'$hide'('$stream') :- !, fail. /* not $STREAM */
'$hide'('$stream_position') :- !, fail. /* not stream position */
'$hide'('$hacks') :- !, fail.
2010-03-14 09:31:25 +00:00
'$hide'('$source_location') :- !, fail.
'$hide'('$messages') :- !, fail.
2011-06-14 09:03:00 +01:00
'$hide'('$push_input_context') :- !, fail.
'$hide'('$pop_input_context') :- !, fail.
'$hide'('$set_source_module') :- !, fail.
'$hide'('$declare_module') :- !, fail.
'$hide'('$store_clause') :- !, fail.
2012-03-22 23:30:02 +00:00
'$hide'('$skip_list') :- !, fail.
2013-11-25 11:16:10 +00:00
'$hide'('$win_insert_menu_item') :- !, fail.
'$hide'('$set_predicate_attribute') :- !, fail.
'$hide'('$parse_quasi_quotations') :- !, fail.
'$hide'('$quasi_quotation') :- !, fail.
'$hide'('$qq_open') :- !, fail.
2016-01-03 02:06:09 +00:00
%'$hide'(Name) :- hide_atom(Name), fail.