A.29 library(option): Option list processing
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(option): Option list processing
          • option/3
          • option/2
          • select_option/3
          • select_option/4
          • merge_options/3
          • meta_options/3
          • dict_options/2
    • Packages
Availability::- use_module(library(option)).(can be autoloaded)
Source[det]dict_options(?Dict, ?Options)
Convert between an option list and a dictionary. One of the arguments must be instantiated. If the option list is created, it is created in canonical form, i.e., using Option(Value) with the Options sorted in the standard order of terms. Note that the conversion is not always possible due to different constraints and conversion may thus lead to (type) errors.

  • Dict keys can be integers. This is not allowed in canonical option lists.
  • Options can hold multiple options with the same key. This is not allowed in dicts. This predicate removes all but the first option on the same key.
  • Options can have more than one value (name(V1,V2)). This is not allowed in dicts.

Also note that most system predicates and predicates using this library for processing the option argument can both work with classical Prolog options and dicts objects.