Changeset 5270
- Timestamp:
- 01/30/10 10:11:21 (6 weeks ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
compiler/logtalk.pl (modified) (3 diffs)
-
configs/b.pl (modified) (1 diff)
-
configs/swi.pl (modified) (1 diff)
-
RELEASE_NOTES.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/compiler/logtalk.pl
r5267 r5270 13368 13368 13369 13369 13370 % '$lgt_tr_predicate_heads'(@callable, -callable) 13371 % 13372 % translates a single predicate head, a conjunction of predicate heads, or a 13373 % list of predicate heads; used as a hook predicate in the config files 13374 13375 '$lgt_tr_predicate_heads'(Head, _) :- 13370 % '$lgt_tr_predicate_heads'(@callable, -callable, @term) 13371 % 13372 % translates a single predicate head, a conjunction of predicate heads, or 13373 % a list of predicate heads; used mainly as a hook predicate in the config 13374 % files for processing proprietary directives 13375 13376 '$lgt_tr_predicate_heads'(Head, _, _) :- 13376 13377 var(Head), 13377 13378 throw(instantiation_error). 13378 '$lgt_tr_predicate_heads'([], [] ) :-13379 '$lgt_tr_predicate_heads'([], [], _) :- 13379 13380 !. 13380 '$lgt_tr_predicate_heads'([Head| Heads], [THead| THeads] ) :-13381 !, 13382 '$lgt_tr_predicate_heads'(Head, THead ),13383 '$lgt_tr_predicate_heads'(Heads, THeads ).13384 '$lgt_tr_predicate_heads'((Head, Heads), (THead, THeads) ) :-13385 !, 13386 '$lgt_tr_predicate_heads'(Head, THead ),13387 '$lgt_tr_predicate_heads'(Heads, THeads ).13388 '$lgt_tr_predicate_heads'(Head, THead ) :-13381 '$lgt_tr_predicate_heads'([Head| Heads], [THead| THeads], Context) :- 13382 !, 13383 '$lgt_tr_predicate_heads'(Head, THead, Context), 13384 '$lgt_tr_predicate_heads'(Heads, THeads, Context). 13385 '$lgt_tr_predicate_heads'((Head, Heads), (THead, THeads), Context) :- 13386 !, 13387 '$lgt_tr_predicate_heads'(Head, THead, Context), 13388 '$lgt_tr_predicate_heads'(Heads, THeads, Context). 13389 '$lgt_tr_predicate_heads'(Head, THead, Context) :- 13389 13390 functor(Head, Functor, Arity), 13390 13391 '$lgt_pp_entity'(_, _, Prefix, _, _), … … 13393 13394 Head =.. [Functor| Args], 13394 13395 THead =.. [TFunctor| Targs], 13395 '$lgt_append'(Args, [_], Targs). 13396 '$lgt_append'(Args, [Context], Targs). 13397 13398 13399 '$lgt_tr_predicate_heads'(Heads, THeads) :- 13400 '$lgt_tr_predicate_heads'(Heads, THeads, _). 13396 13401 13397 13402 … … 13400 13405 % '$lgt_tr_predicate_indicators'(+predicate_indicator, -predicate_indicator) 13401 13406 % 13402 % translates a single predicate indicator, a conjunction of predicate indicators, or a 13403 % list of predicate indicators; used as a hook predicate in the config files 13407 % translates a single predicate indicator, a conjunction of predicate indicators, or 13408 % a list of predicate indicators; used mainly as a hook predicate in the config files 13409 % for processing proprietary directives 13404 13410 13405 13411 '$lgt_tr_predicate_indicators'(PI, _) :- -
trunk/configs/b.pl
r5268 r5270 533 533 '$lgt_tr_predicate_indicators'(PIs, CPIs). 534 534 '$lgt_rewrite_and_copy_pl_directive'(table(':'(Head, N)), table(':'(THead, N))) :- 535 '$lgt_rewrite_and_copy_pl_directive_head'(Head, THead). 535 !, 536 '$lgt_tr_predicate_heads'(Head, THead, '-'). 536 537 '$lgt_rewrite_and_copy_pl_directive'(table(PIs), table(CPIs)) :- 537 538 '$lgt_tr_predicate_indicators'(PIs, CPIs). 538 '$lgt_rewrite_and_copy_pl_directive'(mode(Pred), mode(TPred)) :- 539 functor(Pred, Functor, Arity), 540 '$lgt_tr_predicate_indicators'(Functor/Arity, TFunctor/TArity), 541 functor(TPred, TFunctor, TArity), 542 Pred =.. [Functor| Args], 543 TPred =.. [TFunctor| TArgs], 544 append(Args, ['?'], TArgs). 545 546 547 '$lgt_rewrite_and_copy_pl_directive_head'(Head, _) :- 548 var(Head), 549 throw(instantiation_error). 550 '$lgt_rewrite_and_copy_pl_directive_head'(Head, THead) :- 551 functor(Head, Functor, Arity), 552 \+ (Functor == '/', Arity =:= 2), % not a predicate indicator 553 '$lgt_tr_predicate_indicators'(Functor/Arity, TFunctor/TArity), 554 functor(THead, TFunctor, TArity), 555 Head =.. [_| Args], 556 THead =.. [_| TArgs], 557 append(Args, ['-'], TArgs). 539 '$lgt_rewrite_and_copy_pl_directive'(mode(Head), mode(THead)) :- 540 '$lgt_tr_predicate_heads'(Head, THead, '?'). 558 541 559 542 -
trunk/configs/swi.pl
r5267 r5270 583 583 '$lgt_tr_predicate_indicators'(PIs, CPIs). 584 584 '$lgt_rewrite_and_copy_pl_directive'(index(Head), index(THead)) :- 585 '$lgt_tr_predicate_heads'(Head, THead), 586 Head =.. [_| Args], 587 THead =.. [_| TArgs], 588 '$lgt_append'(Args, [0], TArgs). 585 '$lgt_tr_predicate_heads'(Head, THead, 0). 589 586 '$lgt_rewrite_and_copy_pl_directive'(hash(Head), hash(THead)) :- 590 587 '$lgt_tr_predicate_heads'(Head, THead). -
trunk/RELEASE_NOTES.txt
r5269 r5270 29 29 all config files. 30 30 31 Added '$lgt_tr_predicate_ heads'/2 and '$lgt_tr_predicate_indicators'/232 hook predicates to the Logtalk compiler in order to simplify handling33 o f proprietary directives in config files.31 Added '$lgt_tr_predicate_indicators'/2, '$lgt_tr_predicate_heads'/2, and 32 '$lgt_tr_predicate_heads'/3 hook predicates to the Logtalk compiler in 33 order to simplify handling of proprietary directives in config files. 34 34 35 35 Added support for the proprietary directive eager_consume/0 to the config
