root/tags/lgt291/configs/gnu.config

Revision 7, 6.5 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 GNU Prolog 1.1.2
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(_) :-
30    fail.
31
32
33
34%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
35%
36%  predicate properties
37%
38%  this predicate must return at least static, dynamic and built_in
39%  properties for an existing predicate
40%
41%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42
43
44% lgt_predicate_property(+callable, ?predicate_property)
45
46lgt_predicate_property(Pred, Prop) :-
47    functor(Pred, Functor, Arity),
48    predicate_property(Functor/Arity, Prop).
49
50
51
52%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53%
54%  metapredicates
55%
56%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57
58
59% forall(+callable, +callble)
60
61forall(Generate, Test) :-
62    \+ call((Generate, \+ call(Test))).
63
64
65% lgt_call/2-8
66%
67% use these definitions only if your compiler does
68% not provide call/1-8 as built-in predicates
69
70lgt_call(F, A) :-
71    call_with_args(F, A).
72
73
74lgt_call(F, A1, A2) :-
75    call_with_args(F, A1, A2).
76
77
78lgt_call(F, A1, A2, A3) :-
79    call_with_args(F, A1, A2, A3).
80
81
82lgt_call(F, A1, A2, A3, A4) :-
83    call_with_args(F, A1, A2, A3, A4).
84
85
86lgt_call(F, A1, A2, A3, A4, A5) :-
87    call_with_args(F, A1, A2, A3, A4, A5).
88
89
90lgt_call(F, A1, A2, A3, A4, A5, A6) :-
91    call_with_args(F, A1, A2, A3, A4, A5, A6).
92
93
94lgt_call(F, A1, A2, A3, A4, A5, A6, A7) :-
95    call_with_args(F, A1, A2, A3, A4, A5, A6, A7).
96
97
98% lgt_once/2-8
99%
100% if your compiler provides call/1-8 as built-in
101% predicates rewrite these definitions using call(...), !.
102
103lgt_once(F, A) :-
104    call_with_args(F, A),
105    !.
106
107
108lgt_once(F, A1, A2) :-
109    call_with_args(F, A1, A2),
110    !.
111
112
113lgt_once(F, A1, A2, A3) :-
114    call_with_args(F, A1, A2, A3),
115    !.
116
117
118lgt_once(F, A1, A2, A3, A4) :-
119    call_with_args(F, A1, A2, A3, A4),
120    !.
121
122
123lgt_once(F, A1, A2, A3, A4, A5) :-
124    call_with_args(F, A1, A2, A3, A4, A5),
125    !.
126
127
128lgt_once(F, A1, A2, A3, A4, A5, A6) :-
129    call_with_args(F, A1, A2, A3, A4, A5, A6),
130    !.
131
132
133lgt_once(F, A1, A2, A3, A4, A5, A6, A7) :-
134    call_with_args(F, A1, A2, A3, A4, A5, A6, A7),
135    !.
136
137
138
139%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
140%
141%  file extension predicates
142%
143%  these extensions are used by Logtalk load/compile predicates
144%
145%  you may want to change the extension for Prolog files to match
146%  the one expected by your Prolog compiler
147%
148%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
149
150
151% lgt_file_extension(?atom, ?atom)
152
153lgt_file_extension(logtalk, '.lgt').
154lgt_file_extension(prolog, '.pl').
155lgt_file_extension(xml, '.xml').
156
157
158
159%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
160%
161%  default compiler options
162%
163%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
164
165
166% lgt_default_compiler_option(?atom, ?atom)
167%
168% default values for all compiler options
169
170lgt_default_compiler_option(iso_initialization_dir, true).
171
172lgt_default_compiler_option(xml, on).
173lgt_default_compiler_option(xsl, 'lgtxml.xsl').
174
175lgt_default_compiler_option(unknown, warning).
176lgt_default_compiler_option(misspelt, warning).
177lgt_default_compiler_option(singletons, warning).
178lgt_default_compiler_option(lgtredef, warning).
179lgt_default_compiler_option(plredef, silent).
180
181lgt_default_compiler_option(report, on).
182
183
184
185%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
186%
187%  list predicates
188%
189%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
190
191
192lgt_append(List1, List2, List3) :-
193    append(List1, List2, List3).
194
195
196lgt_member(Element, List) :-
197    member(Element, List).
198
199
200lgt_member_var(V, [H| _]) :-
201    V == H.
202lgt_member_var(V, [_| T]) :-
203    lgt_member_var(V, T).
204
205
206lgt_proper_list(List) :-
207    list(List).
208
209
210
211%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
212%
213%  file predicates
214%
215%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
216
217
218% lgt_file_exists(+atom)
219%
220% see if a file exist in the current directory
221
222lgt_file_exists(File) :-
223    file_exists(File).
224
225
226% lgt_load_prolog_code(+atom)
227%
228% compile and load a Prolog file
229
230lgt_load_prolog_code(File) :-
231    consult(File).
232
233
234
235%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
236%
237%  sorting predicates
238%
239%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
240
241
242% lgt_keysort(+list, -list)
243
244lgt_keysort(List, Sorted) :-
245    keysort(List, Sorted).
246
247
248% lgt_sort(+list, -list)
249
250lgt_sort(List, Sorted) :-
251    sort(List, Sorted).
252
253
254
255%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
256%
257%  time and date predicates
258%
259%  if your Prolog compiler does not provide access to the operating system
260%  time and date just write dummy definitions
261%
262%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
263
264
265% lgt_current_date(?Year, ?Month, ?Day)
266
267lgt_current_date(Year, Month, Day) :-
268    date_time(dt(Year, Month, Day, _, _, _)).
269
270
271% lgt_current_time(?Hours, ?Mins, ?Secs)
272
273lgt_current_time(Hours, Mins, Secs) :-
274    date_time(dt(_, _, _, Hours, Mins, Secs)).
275
276
277
278%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
279%
280%  timing predicate
281%
282%  if your Prolog compiler does not provide access to a timing predicate
283%  just write dummy definition
284%
285%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
286
287
288% lgt_cpu_time(-Seconds)
289
290lgt_cpu_time(Seconds) :-
291    cpu_time(Miliseconds),
292    Seconds is Miliseconds / 1000.
293
294
295
296%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
297%
298%  comparison predicate
299%
300%  the usual compare/3 definition
301%
302%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
303
304
305% compare(?atom, @term, @term) -- built-in
306
307
308
309%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
310%
311%  end!
312%
313%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.