root/tags/lgt293/configs/eclipseiso.config

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