• 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
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

2.12 The class PlAtom - Supporting Prolog constants (version 2)
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • A C++ interface to SWI-Prolog
        • A C++ interface to SWI-Prolog (Version 2)
          • The class PlAtom - Supporting Prolog constants (version 2)
            • Direct comparision to char *
            • Direct comparision to PlAtom
            • Extraction of the atom and comparison to PlAtom
            • Extraction of the atom and comparison to char *

2.12.2 Direct comparision to PlAtom

Example:

static PlAtom ATOM_read("read");

PREDICATE(test, 1)
{ if ( A1 == ATOM_read )
    ...;
}

This case raises a type_error if A1 is not an atom. Otherwise it extacts the atom-handle and compares it to the atom-handle of the global PlAtom object. This approach is faster and provides more strict type-checking.

ClioPatria (version V3.1.1-48-gf653ce4)