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

  • swipl
    • library
      • error.pl
      • debug.pl
      • apply.pl
      • lists.pl
      • broadcast.pl -- Event service
      • shlib.pl
      • option.pl -- Option list processing
      • thread_pool.pl -- Resource bounded thread management
      • gensym.pl
      • 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
      • record.pl -- Access compound arguments by name
      • 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 -- Analyse format specifications
      • pure_input.pl -- Pure Input from files and streams
      • solution_sequences.pl -- Modify solution sequences
      • ordsets.pl
      • random.pl -- Random numbers
      • base64.pl -- Base64 encoding and decoding
      • aggregate.pl -- Aggregation operators on backtrackable predicates
      • predicate_options.pl
      • csv.pl -- Process CSV (Comma-Separated Values) data
      • pprint.pl
      • atom.pl -- Operations on atoms
      • modules.pl -- Module utility predicates
      • occurs.pl
      • prolog_xref.pl
      • prolog_colour.pl -- Prolog syntax colouring support.
      • 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
      • www_browser.pl
      • prolog_pack.pl
      • git.pl
      • utf8.pl -- UTF-8 encoding/decoding on lists of character codes.
      • quintus.pl -- Quintus compatibility
      • prolog_versions.pl -- Demand specific (Prolog) versions
      • prolog_wrap.pl -- Wrapping predicates
      • dialect.pl
      • date.pl
      • persistency.pl
      • iostream.pl -- Utilities to deal with streams
      • prolog_code.pl -- Utilities for reasoning about code
      • strings.pl -- String utilities
      • dif.pl -- The dif/2 constraint
      • edinburgh.pl -- Some traditional Edinburgh predicates
      • terms.pl -- Term manipulation
      • ansi_term.pl -- Print decorated text to ANSI consoles
      • 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 -- Utilities for numbered terms
      • rbtrees.pl -- Red black trees
      • backcomp.pl -- Backward compatibility
      • charsio.pl -- I/O on Lists of Character Codes
      • check.pl
      • prolog_jiti.pl -- Just In Time Indexing (JITI) utilities
      • listing.pl
      • writef.pl
      • prolog_config.pl
      • statistics.pl -- Get information about resource usage
      • base32.pl
      • codesio.pl -- I/O on Lists of Character Codes
      • coinduction.pl -- Co-Logic Programming
      • heaps.pl -- heaps/priority queues
      • when.pl
      • optparse.pl
      • ctypes.pl -- Character code classification
      • thread.pl
      • shell.pl -- Elementary shell commands
      • nb_set.pl -- Non-backtrackable sets
      • intercept.pl -- Intercept and signal interface
      • prolog_debug.pl
      • help.pl -- Text based manual
      • hashtable.pl
      • prolog_profile.pl
      • tables.pl -- XSB interface to tables
      • system.pl
      • prolog_trace.pl
      • nb_rbtrees.pl
      • increval.pl
      • fastrw.pl
      • readln.pl
      • make.pl -- Reload modified source files
      • prolog_coverage.pl
      • qsave.pl
      • zip.pl -- Access resource ZIP archives
      • edit.pl -- Editor interface
      • prolog_metainference.pl
      • explain.pl
      • prolog_codewalk.pl -- Prolog code walker
      • prolog_history.pl
      • oset.pl
      • macros.pl
      • portray_text.pl
      • prolog_autoload.pl
      • check_installation.pl -- Check installation issues and features
      • rwlocks.pl
      • exceptions.pl
      • streams.pl
      • prolog_deps.pl
      • vm.pl
      • qpforeign.pl
      • files.pl
      • tty.pl
      • pio.pl
      • tabling.pl
 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.