• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
    • DSS Queries
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

4.16 Examining the program
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Built-in Predicates
        • Examining the program
          • current_atom/1
          • current_blob/2
          • current_functor/2
          • current_flag/1
          • current_key/1
          • current_predicate/1
          • current_predicate/2
          • predicate_property/2
          • dwim_predicate/2
          • clause/2
          • clause/3
          • nth_clause/3
          • clause_property/2
    • Packages
Availability:built-in
Sourcecurrent_predicate(?Name, :Head)
Classical pre-ISO implementation of current_predicate/1, where the predicate is represented by the head term. The advantage is that this can be used for checking the existence of a predicate before calling it without the need for functor/3:
call_if_exists(G) :-
        current_predicate(_, G),
        call(G).

Because of this intended usage, current_predicate/2 also succeeds if the predicate can be autoloaded. Unfortunately, checking the autoloader makes this predicate relatively slow, in particular because a failed lookup of the autoloader will cause the autoloader to verify that its index is up-to-date.

ClioPatria (version V3.1.1-21-gb8003bb)