/usr/local/lib/swipl/library/dicts.pl
All Application Manual Name SummaryHelp

  • swipl
    • library
      • error.pl
      • debug.pl -- Print debug messages and test assertions
      • apply.pl -- Apply predicates on a list
      • lists.pl -- List Manipulation
      • broadcast.pl -- Event service
      • shlib.pl
      • option.pl -- Option list processing
      • thread_pool.pl -- Resource bounded thread management
      • gensym.pl -- Generate unique symbols
      • settings.pl -- Setting management
      • arithmetic.pl -- Extensible arithmetic
      • main.pl -- Provide entry point for scripts
      • readutil.pl -- Read utilities
      • operators.pl
      • pairs.pl
      • prolog_source.pl -- Examine Prolog source-files
      • record.pl -- Access compound arguments by name
      • quasi_quotations.pl -- Define Quasi Quotation syntax
      • pure_input.pl
      • solution_sequences.pl
      • ordsets.pl -- Ordered set manipulation
      • random.pl -- Random numbers
      • base64.pl -- Base64 encoding and decoding
      • aggregate.pl -- Aggregation operators on backtrackable predicates
      • yall.pl
      • sandbox.pl
      • apply_macros.pl -- Goal expansion rules to avoid meta-calling
      • assoc.pl -- Binary associations
      • prolog_format.pl -- Analyse format specifications
      • predicate_options.pl
      • csv.pl -- Process CSV (Comma-Separated Values) data
      • pprint.pl
      • atom.pl
      • modules.pl -- Module utility predicates
      • occurs.pl -- Finding and counting sub-terms
      • prolog_xref.pl -- Prolog cross-referencer data collection
      • prolog_colour.pl
      • lazy_lists.pl -- Lazy list handling
      • ugraphs.pl -- Graph manipulation library
      • url.pl -- Analysing and constructing URL
      • www_browser.pl
      • prolog_pack.pl
      • git.pl -- Run GIT commands
      • utf8.pl
      • dialect.pl -- Support multiple Prolog dialects
      • system.pl -- System utilities
      • terms.pl -- Term manipulation
      • date.pl -- Process dates and times
      • persistency.pl -- Provide persistent dynamic predicates
      • iostream.pl -- Utilities to deal with streams
      • prolog_stack.pl
      • edinburgh.pl -- Some traditional Edinburgh predicates
      • prolog_clause.pl
      • prolog_breakpoints.pl
      • wfs.pl -- Well Founded Semantics interface
      • prolog_code.pl -- Utilities for reasoning about code
      • sort.pl
      • dicts.pl -- Dict utilities
        • mapdict/2
        • mapdict/3
        • mapdict/4
        • dicts_same_tag/2
        • dict_size/2
        • dict_keys/2
        • dicts_same_keys/2
        • dicts_to_same_keys/3
        • dict_fill/4
        • dicts_join/3
        • dicts_join/4
        • dicts_slice/3
        • dicts_to_compounds/4
      • dif.pl -- The dif/2 constraint
      • varnumbers.pl -- Utilities for numbered terms
      • pio.pl -- Pure I/O
      • base32.pl -- Base32 encoding and decoding
      • charsio.pl
      • codesio.pl -- I/O on Lists of Character Codes
      • coinduction.pl -- Co-Logic Programming
      • heaps.pl -- heaps/priority queues
      • rbtrees.pl -- Red black trees
      • statistics.pl -- Get information about resource usage
      • when.pl -- Conditional coroutining
      • backcomp.pl
      • prolog_versions.pl -- Demand specific (Prolog) versions
      • ansi_term.pl
      • thread.pl
      • listing.pl
      • zip.pl
      • quintus.pl
      • writef.pl -- Old-style formatted write
      • optparse.pl -- command line parsing
      • edit.pl -- Editor interface
      • prolog_coverage.pl
      • nb_set.pl
      • prolog_codewalk.pl
      • prolog_metainference.pl -- Infer meta-predicate properties
      • prolog_profile.pl -- Execution profiler
      • rwlocks.pl -- Read/write locks
      • make.pl -- Reload modified source files
      • macros.pl -- Macro expansion
      • threadutil.pl -- Interactive thread utilities
      • check.pl -- Consistency checking
      • intercept.pl
      • prolog_trace.pl -- Print access to predicates
      • ctypes.pl -- Character code classification
      • increval.pl
      • tables.pl
      • prolog_jiti.pl -- Just In Time Indexing (JITI) utilities
      • strings.pl -- String utilities
      • tty.pl
      • streams.pl
      • files.pl
      • prolog_autoload.pl
      • prolog_debug.pl -- User level debugging tools
      • help.pl -- Text based manual
      • fastrw.pl -- Fast reading and writing of terms
      • readln.pl
      • shell.pl -- Elementary shell commands
      • prolog_history.pl
      • prolog_config.pl
      • hashtable.pl
      • explain.pl
      • prolog_wrap.pl -- Wrapping predicates
      • qsave.pl
      • oset.pl
 dict_fill(+ValueIn, +Key, +Dict, -Value) is det
Implementation for the dicts_to_same_keys/3 OnEmpty closure that fills new cells with a copy of ValueIn. Note that copy_term/2 does not really copy ground terms. Below are two examples. Note that when filling empty cells with a variable, each empty cell is bound to a new variable.
?- dicts_to_same_keys([r{x:1}, r{y:2}], dict_fill(null), L).
L = [r{x:1, y:null}, r{x:null, y:2}].
?- dicts_to_same_keys([r{x:1}, r{y:2}], dict_fill(_), L).
L = [r{x:1, y:_G2005}, r{x:_G2036, y:2}].

Use dict_no_fill/3 to raise an error if a dict is missing a key.