root/tags/lgt291/configs/swi329.config

Revision 7, 7.0 KB (checked in by pmoura, 7 years ago)

Corrected compiler bug in the error checking code of directives info/1 and info/2.
Change the "mi" example objects loading order to avoid some "unknown entity" warnings.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%
3%  Logtalk - Object oriented extension to Prolog
4%  Release 2.9.1
5%
6%  configuration file for SWI Prolog 3.2.9
7%
8%  last updated: August 24, 2000
9%
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12
13
14
15%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16%
17%  ISO Prolog Standard predicates that we must define because they are
18%  not built-in
19%
20%  add a clause for lgt_iso_predicate/1 declaring each ISO predicate that
21%  we must define; there must be at least one clause for this predicate
22%  whose call should fail if we don't define any ISO predicates
23%
24%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25
26
27% lgt_iso_predicate(?callable).
28
29lgt_iso_predicate(atom_codes(_, _)).
30lgt_iso_predicate(atom_concat(_, _, _)).
31lgt_iso_predicate(current_predicate(_)).
32lgt_iso_predicate(number_codes(_, _)).
33
34
35atom_codes(Atom, Codes) :-
36    atom_chars(Atom, Codes).
37
38
39atom_concat(Atom1, Atom2, Atom3) :-
40    nonvar(Atom1), nonvar(Atom2),
41    !,
42    name(Atom1, Codes1),
43    name(Atom2, Codes2),
44    lgt_append(Codes1, Codes2, Codes3),
45    name(Atom3, Codes3).
46
47atom_concat(Atom1, Atom2, Atom3) :-
48    nonvar(Atom3),
49    !,
50    name(Atom3, Codes3),
51    lgt_append(Codes1, Codes2, Codes3),
52    name(Atom1, Codes1),
53    name(Atom2, Codes2).
54
55
56current_predicate(Functor/Arity) :-
57    current_predicate(Functor, Head),
58    functor(Head, Functor, Arity).
59
60
61number_codes(Number, Codes) :-
62    number_chars(Number, Codes).
63
64
65
66%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
67%
68%  predicate properties
69%
70%  this predicate must return at least static, dynamic and built_in
71%  properties for an existing predicate
72%
73%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
74
75
76% lgt_predicate_property(+callable, ?predicate_property)
77
78lgt_predicate_property(Pred, Prop) :-
79    predicate_property(Pred, Prop).
80
81
82
83%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
84%
85%  metapredicates
86%
87%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
88
89
90% lgt_call/2-8
91%
92% use these definitions only if your compiler does
93% not provide call/1-8 as built-in predicates
94
95lgt_call(F, A) :-
96    call(F, A).
97
98
99lgt_call(F, A1, A2) :-
100    call(F, A1, A2).
101
102
103lgt_call(F, A1, A2, A3) :-
104    call(F, A1, A2, A3).
105
106
107lgt_call(F, A1, A2, A3, A4) :-
108    call(F, A1, A2, A3, A4).
109
110
111lgt_call(F, A1, A2, A3, A4, A5) :-
112    call(F, A1, A2, A3, A4, A5).
113
114
115lgt_call(F, A1, A2, A3, A4, A5, A6) :-
116    apply(F, [A1, A2, A3, A4, A5, A6]).
117
118
119lgt_call(F, A1, A2, A3, A4, A5, A6, A7) :-
120    apply(F, [A1, A2, A3, A4, A5, A6, A7]).
121
122
123% lgt_once/2-8
124%
125% if your compiler provides call/1-8 as built-in
126% predicates rewrite these definitions using call(...), !.
127
128lgt_once(F, A) :-
129    call(F, A),
130    !.
131
132
133lgt_once(F, A1, A2) :-
134    call(F, A1, A2),
135    !.
136
137
138lgt_once(F, A1, A2, A3) :-
139    call(F, A1, A2, A3),
140    !.
141
142
143lgt_once(F, A1, A2, A3, A4) :-
144    call(F, A1, A2, A3, A4),
145    !.
146
147
148lgt_once(F, A1, A2, A3, A4, A5) :-
149    call(F, A1, A2, A3, A4, A5),
150    !.
151
152
153lgt_once(F, A1, A2, A3, A4, A5, A6) :-
154    apply(F, [A1, A2, A3, A4, A5, A6]),
155    !.
156
157
158lgt_once(F, A1, A2, A3, A4, A5, A6, A7) :-
159    apply(F, [A1, A2, A3, A4, A5, A6, A7]),
160    !.
161
162
163%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
164%
165%  file extension predicates
166%
167%  these extensions are used by Logtalk load/compile predicates
168%
169%  you may want to change the extension for Prolog files to match
170%  the one expected by your Prolog compiler
171%
172%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
173
174
175% lgt_file_extension(?atom, ?atom)
176
177lgt_file_extension(logtalk, '.lgt').
178lgt_file_extension(prolog, '.pl').
179lgt_file_extension(xml, '.xml').
180
181
182
183%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
184%
185%  default compiler options
186%
187%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
188
189
190% lgt_default_compiler_option(?atom, ?atom)
191%
192% default values for all compiler options
193
194lgt_default_compiler_option(iso_initialization_dir, true).
195
196lgt_default_compiler_option(xml, on).
197lgt_default_compiler_option(xsl, 'lgtxml.xsl').
198
199lgt_default_compiler_option(unknown, warning).
200lgt_default_compiler_option(misspelt, warning).
201lgt_default_compiler_option(singletons, warning).
202lgt_default_compiler_option(lgtredef, warning).
203lgt_default_compiler_option(plredef, silent).
204
205lgt_default_compiler_option(report, on).
206
207
208
209%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
210%
211%  list predicates
212%
213%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
214
215
216lgt_append([], List, List).
217lgt_append([Head| Tail], List, [Head| Tail2]) :-
218    lgt_append(Tail, List, Tail2).
219
220
221lgt_member(Head, [Head| _]).
222lgt_member(Head, [_| Tail]) :-
223    lgt_member(Head, Tail).
224
225
226lgt_member_var(V, [H| _]) :-
227    V == H.
228lgt_member_var(V, [_| T]) :-
229    lgt_member_var(V, T).
230
231
232lgt_proper_list([]).
233lgt_proper_list([_| List]) :-
234    lgt_proper_list(List).
235
236
237
238%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
239%
240%  file predicates
241%
242%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
243
244
245% lgt_file_exists(+atom)
246%
247% see if a file exist in the current directory
248
249lgt_file_exists(File) :-
250    exists_file(File).
251
252
253% lgt_load_prolog_code(+atom)
254%
255% compile and load a Prolog file
256
257lgt_load_prolog_code(File) :-
258    consult(File).
259
260
261
262%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
263%
264%  sorting predicates
265%
266%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
267
268
269% lgt_keysort(+list, -list)
270
271lgt_keysort(List, Sorted) :-
272    keysort(List, Sorted).
273
274
275% lgt_sort(+list, -list)
276
277lgt_sort(List, Sorted) :-
278    sort(List, Sorted).
279
280
281
282%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
283%
284%  time and date predicates
285%
286%  if your Prolog compiler does not provide access to the operating system
287%  time and date just write dummy definitions
288%
289%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
290
291
292% lgt_current_date(?Year, ?Month, ?Day)
293
294lgt_current_date(Year, Month, Day) :-
295    get_time(Time),
296    convert_time(Time, Year, Month, Day, _, _, _, _).
297
298
299% lgt_current_time(?Hours, ?Mins, ?Secs)
300
301lgt_current_time(Hours, Mins, Secs) :-
302    get_time(Time),
303    convert_time(Time, _, _, _, Hours, Mins, Secs, _).
304
305
306
307%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
308%
309%  timing predicate
310%
311%  if your Prolog compiler does not provide access to a timing predicate
312%  just write dummy definition
313%
314%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
315
316
317% lgt_cpu_time(-Seconds)
318
319lgt_cpu_time(Seconds) :-
320    Seconds is cputime.
321
322
323
324%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
325%
326%  comparison predicate
327%
328%  the usual compare/3 definition
329%
330%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
331
332
333% compare(?atom, @term, @term) -- built-in
334
335
336
337%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
338%
339%  end!
340%
341%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.