root/tags/lgt293/configs/swi329.config

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

Changed comments about Logtalk flags.

  • 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.3
5%
6%  configuration file for SWI Prolog 3.2.9
7%
8%  last updated: December 30, 2001
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 flag values
186%
187%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
188
189
190% lgt_default_flag(?atom, ?atom)
191%
192% default values for all flags
193
194lgt_default_flag(iso_initialization_dir, true).
195
196lgt_default_flag(xml, on).
197lgt_default_flag(xsl, 'lgtxml.xsl').
198
199lgt_default_flag(unknown, warning).
200lgt_default_flag(misspelt, warning).
201lgt_default_flag(singletons, warning).
202lgt_default_flag(lgtredef, warning).
203lgt_default_flag(plredef, silent).
204lgt_default_flag(portability, silent).
205
206lgt_default_flag(report, on).
207
208
209
210%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
211%
212%  list predicates
213%
214%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
215
216
217lgt_append([], List, List).
218lgt_append([Head| Tail], List, [Head| Tail2]) :-
219    lgt_append(Tail, List, Tail2).
220
221
222lgt_member(Head, [Head| _]).
223lgt_member(Head, [_| Tail]) :-
224    lgt_member(Head, Tail).
225
226
227lgt_member_var(V, [H| _]) :-
228    V == H.
229lgt_member_var(V, [_| T]) :-
230    lgt_member_var(V, T).
231
232
233lgt_proper_list([]).
234lgt_proper_list([_| List]) :-
235    lgt_proper_list(List).
236
237
238
239%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
240%
241%  file predicates
242%
243%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
244
245
246% lgt_file_exists(+atom)
247%
248% see if a file exist in the current directory
249
250lgt_file_exists(File) :-
251    exists_file(File).
252
253
254% lgt_load_prolog_code(+atom)
255%
256% compile and load a Prolog file
257
258lgt_load_prolog_code(File) :-
259    consult(File).
260
261
262
263%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
264%
265%  sorting predicates
266%
267%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
268
269
270% lgt_keysort(+list, -list)
271
272lgt_keysort(List, Sorted) :-
273    keysort(List, Sorted).
274
275
276% lgt_sort(+list, -list)
277
278lgt_sort(List, Sorted) :-
279    sort(List, Sorted).
280
281
282
283%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
284%
285%  time and date predicates
286%
287%  if your Prolog compiler does not provide access to the operating system
288%  time and date just write dummy definitions
289%
290%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
291
292
293% lgt_current_date(?Year, ?Month, ?Day)
294
295lgt_current_date(Year, Month, Day) :-
296    get_time(Time),
297    convert_time(Time, Year, Month, Day, _, _, _, _).
298
299
300% lgt_current_time(?Hours, ?Mins, ?Secs)
301
302lgt_current_time(Hours, Mins, Secs) :-
303    get_time(Time),
304    convert_time(Time, _, _, _, Hours, Mins, Secs, _).
305
306
307
308%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
309%
310%  timing predicate
311%
312%  if your Prolog compiler does not provide access to a timing predicate
313%  just write dummy definition
314%
315%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
316
317
318% lgt_cpu_time(-Seconds)
319
320lgt_cpu_time(Seconds) :-
321    Seconds is cputime.
322
323
324
325%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
326%
327%  comparison predicate
328%
329%  the usual compare/3 definition
330%
331%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
332
333
334% compare(?atom, @term, @term) -- built-in
335
336
337
338%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
339%
340%  end!
341%
342%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.