rstore user_defined_directive

This commit is contained in:
Vitor Santos Costa 2009-12-04 00:29:50 +00:00
parent 367f1d954f
commit ee575387af
1 changed files with 13 additions and 0 deletions

View File

@ -149,6 +149,19 @@
'$exec_directive'(endif, Context, _) :-
'$endif'(Context).
%
% allow users to define their own directives.
%
user_defined_directive(Dir,_) :-
'$directive'(Dir), !.
user_defined_directive(Dir,Action) :-
functor(Dir,Na,Ar),
functor(NDir,Na,Ar),
'$current_module'(M, prolog),
assert_static('$directive'(NDir)),
assert_static(('$exec_directive'(Dir, _, _) :- Action)),
'$current_module'(_, M).
yap_flag(V,Out) :-
'$user_defined_flag'(V,_,_,_),