/usr/local/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
      • lists.pl
      • broadcast.pl
      • shlib.pl
      • option.pl
      • thread_pool.pl
      • gensym.pl
      • settings.pl
      • arithmetic.pl
      • main.pl
      • readutil.pl
      • operators.pl
      • pairs.pl
      • prolog_source.pl
      • record.pl -- Access compound arguments by name
      • quasi_quotations.pl
      • pure_input.pl
      • solution_sequences.pl -- Modify solution sequences
      • ordsets.pl
      • random.pl
      • base64.pl -- Base64 encoding and decoding
      • aggregate.pl
      • yall.pl
      • sandbox.pl
      • apply_macros.pl -- Goal expansion rules to avoid meta-calling
      • assoc.pl
      • prolog_format.pl
      • predicate_options.pl
      • csv.pl
      • pprint.pl
      • atom.pl
      • modules.pl
      • 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
      • url.pl
      • www_browser.pl
      • prolog_pack.pl
      • git.pl
      • utf8.pl
      • dialect.pl
      • system.pl
      • terms.pl
      • date.pl
      • persistency.pl
      • iostream.pl -- Utilities to deal with streams
      • prolog_stack.pl
      • edinburgh.pl
      • prolog_clause.pl
      • prolog_breakpoints.pl
      • wfs.pl
      • prolog_code.pl
      • sort.pl
      • dicts.pl
      • dif.pl -- The dif/2 constraint
      • varnumbers.pl
      • pio.pl
      • prolog_versions.pl -- Demand specific (Prolog) versions
      • prolog_profile.pl
      • prolog_coverage.pl
      • base32.pl -- Base32 encoding and decoding
      • charsio.pl
      • codesio.pl -- I/O on Lists of Character Codes
      • coinduction.pl
      • heaps.pl
      • rbtrees.pl
      • statistics.pl
      • when.pl
      • backcomp.pl
      • oset.pl
      • strings.pl
      • fastrw.pl
      • optparse.pl
      • make.pl
      • nb_set.pl
      • prolog_autoload.pl
      • check.pl -- Consistency checking
      • prolog_codewalk.pl -- Prolog code walker
      • thread.pl -- High level thread primitives
      • threadutil.pl -- Interactive thread utilities
      • ctypes.pl -- Character code classification
      • increval.pl
      • tables.pl
      • prolog_metainference.pl -- Infer meta-predicate properties
      • zip.pl
      • explain.pl
      • streams.pl -- Manage Prolog streams
      • prolog_debug.pl
      • prolog_wrap.pl
      • ansi_term.pl -- Print decorated text to ANSI consoles
      • listing.pl -- List programs and pretty print clauses
      • shell.pl
      • writef.pl -- Old-style formatted write
      • edit.pl -- Editor interface
      • intercept.pl
      • prolog_trace.pl -- Print access to predicates
      • help.pl
      • quintus.pl
      • rwlocks.pl
      • macros.pl
      • portray_text.pl
      • prolog_config.pl
      • prolog_jiti.pl -- Just In Time Indexing (JITI) utilities
      • qsave.pl
      • prolog_history.pl
      • hashtable.pl
      • exceptions.pl
      • tty.pl
      • readln.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.