4.33 Global variables
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Built-in Predicates
        • Global variables
          • b_setval/2
          • b_getval/2
          • nb_setval/2
          • nb_getval/2
          • nb_linkval/2
          • nb_current/2
          • nb_delete/1
          • Compatibility of SWI-Prolog Global Variables
    • Packages
Availability:built-in
nb_getval(+Name, -Value)
The nb_getval/2 predicate is a synonym for b_getval/2, introduced for compatibility and symmetry. As most scenarios will use a particular global variable using either non-backtrackable or backtrackable assignment, using nb_getval/2 can be used to document that the variable is non-backtrackable. Raises existence_error(variable, Name) if the variable does not exist. Alternatively, nb_current/2 can used to query a global variable. This version fails if the variable does not exist rather than raising an exception.