/usr/lib/swipl/library/lazy_lists.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
      • broadcast.pl
      • shlib.pl
      • option.pl
      • thread_pool.pl -- Resource bounded thread management
      • gensym.pl
      • settings.pl -- Setting management
      • arithmetic.pl -- Extensible arithmetic
      • main.pl
      • readutil.pl -- Read utilities
      • operators.pl
      • pairs.pl
      • prolog_source.pl -- Examine Prolog source-files
      • record.pl
      • quasi_quotations.pl -- Define Quasi Quotation syntax
      • sandbox.pl
      • apply_macros.pl -- Goal expansion rules to avoid meta-calling
      • yall.pl
      • assoc.pl -- Binary associations
      • prolog_format.pl
      • pure_input.pl
      • solution_sequences.pl -- Modify solution sequences
      • ordsets.pl -- Ordered set manipulation
      • random.pl
      • base64.pl -- Base64 encoding and decoding
      • aggregate.pl -- Aggregation operators on backtrackable predicates
      • predicate_options.pl
      • csv.pl
      • 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
        • lazy_list/2
        • lazy_list/3
        • lazy_list_materialize/1
        • lazy_list_length/2
        • lazy_list_iterator/4
        • lazy_get_codes/4
        • lazy_read_terms/4
        • lazy_read_lines/4
        • lazy_message_queue/4
        • lazy_engine_next/4
        • lazy_findall/3
        • lazy_findall/4
      • ugraphs.pl -- Graph manipulation library
      • url.pl -- Analysing and constructing URL
      • www_browser.pl -- Open a URL in the users browser
      • prolog_pack.pl -- A package manager for Prolog
      • git.pl -- Run GIT commands
      • utf8.pl -- UTF-8 encoding/decoding on lists of character codes.
      • quintus.pl
      • prolog_versions.pl
      • prolog_wrap.pl
      • dialect.pl
      • date.pl
      • persistency.pl
      • iostream.pl -- Utilities to deal with streams
      • prolog_code.pl
      • strings.pl
      • dif.pl
      • edinburgh.pl
      • terms.pl
      • ansi_term.pl
      • threadutil.pl -- Interactive thread utilities
      • prolog_stack.pl -- Examine the Prolog stack
      • prolog_clause.pl
      • prolog_breakpoints.pl
      • wfs.pl
      • sort.pl
      • dicts.pl
      • varnumbers.pl
      • rbtrees.pl -- Red black trees
      • backcomp.pl -- Backward compatibility
      • charsio.pl -- I/O on Lists of Character Codes
      • prolog_coverage.pl
      • statistics.pl -- Get information about resource usage
      • coinduction.pl -- Co-Logic Programming
      • heaps.pl -- heaps/priority queues
      • when.pl
      • ctypes.pl -- Character code classification
      • base32.pl -- Base32 encoding and decoding
      • codesio.pl -- I/O on Lists of Character Codes
      • intercept.pl
      • prolog_history.pl -- Per-directory persistent commandline history
      • increval.pl -- Incremental dynamic predicate modification
      • hashtable.pl
      • explain.pl
      • listing.pl
      • check_installation.pl -- Check installation issues and features
      • tables.pl -- XSB interface to tables
      • fastrw.pl
      • prolog_config.pl -- Provide configuration information
      • prolog_autoload.pl -- Autoload all dependencies
      • check.pl
      • make.pl
      • macros.pl -- Macro expansion
      • exceptions.pl
      • qsave.pl
      • zip.pl
      • nb_set.pl -- Non-backtrackable sets
      • prolog_debug.pl
      • portray_text.pl
      • optparse.pl
      • files.pl
      • shell.pl -- Elementary shell commands
      • help.pl
      • prolog_profile.pl
      • system.pl -- System utilities
      • prolog_trace.pl
      • prolog_jiti.pl
      • writef.pl -- Old-style formatted write
      • thread.pl -- High level thread primitives
      • rwlocks.pl -- Read/write locks
      • prolog_codewalk.pl -- Prolog code walker
      • prolog_deps.pl
      • vm.pl
      • edit.pl -- Editor interface
      • oset.pl
      • streams.pl
      • tty.pl
      • qpforeign.pl
      • tableutil.pl
      • nb_rbtrees.pl
      • prolog_metainference.pl -- Infer meta-predicate properties
 lazy_list(:Next, -List)
Create a lazy list from a callback. Next is called repeatedly to extend the list. It is called as call(Next, List, Tail), where the difference list List\Tail produces the next slice of the list. If the end of the input is reached, List must be a proper list and Tail must be [].
bug
- The content returned by the iterator is duplicated in nb_setarg/3. This is needed by avoid the risk of trailed assignments in the structure. Avoiding this duplication would significantly reduce the overhead.