-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathload_demo.pro
58 lines (45 loc) · 913 Bytes
/
load_demo.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
:- annotate(file,[
purpose-"test loader"
, problem-"need more convincing demo"
, tags-[
architecture
, demo
, example
, test
]
]).
:- export([
hello/0
, goodbye/0
, my_throw/0
]).
:- include("load_demo_include.pro").
:- import(file("load_demo_import.pro"),[
data/1
, hi/0
, hi/0 as say_hi
]).
:- annotate([
purpose-"say hello"
]).
hello :-
format('~w~n',['Hello world.']).
test_meta_predicate :-
call(hi),
call(hello),
call(goodbye),
assertz(data(test)).
test_call(A) :- call(A).
test_import_rename :-
say_hi.
:- section("test shadowing").
member(Elem, Array) :-
arg(_, Array, Elem).
test_shadow :-
forall(member(A, array(1,2,3)),
writeln(A)).
:- end_section.
:- section("test exception stack trace").
my_throw :-
throw(error(test,_)).
:- end_section.