Permalink
Browse files

Add zipper predicates for deleting the current element

  • Loading branch information...
pmoura committed Jan 11, 2019
1 parent e28e1d8 commit c34def0e83834281fce67fb9922da154fa83ba88
@@ -17,4 +17,4 @@ Indices and tables
* :ref:`genindex`
* :ref:`search`

Generated on Fri Jan 11 14:15:55 WET 2019
Generated on Fri Jan 11 15:27:16 WET 2019
@@ -1249,6 +1249,36 @@ Predicate index
* :ref:`dictionaryp <dictionaryp/0::delete/4>`
* :ref:`heapp <heapp/0::delete/4>`

``delete_and_next/2``
---------------------

.. toctree::
:maxdepth: 1



* :ref:`zipperp <zipperp/0::delete_and_next/2>`

``delete_and_previous/2``
-------------------------

.. toctree::
:maxdepth: 1



* :ref:`zipperp <zipperp/0::delete_and_previous/2>`

``delete_and_unzip/2``
----------------------

.. toctree::
:maxdepth: 1



* :ref:`zipperp <zipperp/0::delete_and_unzip/2>`

``delete_directory/1``
----------------------

@@ -103,7 +103,7 @@ Moves to the next element. Fails if already at the last elements.
| **Template:**
| ``next(Zipper,NewZipper)``
| **Mode and number of proofs:**
| ``next(+zipper,-zipper)`` - ``zero_or_one``
| ``next(+zipper,--zipper)`` - ``zero_or_one``


.. raw:: html
@@ -124,7 +124,7 @@ Moves to and returns the next element. Fails if already at the last elements.
| **Template:**
| ``next(Zipper,NewZipper,Next)``
| **Mode and number of proofs:**
| ``next(+zipper,-zipper,-term)`` - ``zero_or_one``
| ``next(+zipper,--zipper,-term)`` - ``zero_or_one``


.. raw:: html
@@ -145,7 +145,7 @@ Moves to the previous element. Fails if already at the first elements.
| **Template:**
| ``previous(Zipper,NewZipper)``
| **Mode and number of proofs:**
| ``previous(+zipper,-zipper)`` - ``zero_or_one``
| ``previous(+zipper,--zipper)`` - ``zero_or_one``


.. raw:: html
@@ -158,15 +158,15 @@ Moves to the previous element. Fails if already at the first elements.
``previous/3``
^^^^^^^^^^^^^^

Moves to and returns the previous element. Fails if already at the first elements.
Moves to and returns the previous element. Fails if already at the first element.

| **Compilation flags:**
| ``static``

| **Template:**
| ``previous(Zipper,NewZipper,Previous)``
| **Mode and number of proofs:**
| ``previous(+zipper,-zipper,-term)`` - ``zero_or_one``
| ``previous(+zipper,--zipper,-term)`` - ``zero_or_one``


.. raw:: html
@@ -192,6 +192,48 @@ Applies a closure to the current element.
| ``apply(+callable,+zipper)`` - ``zero_or_more``


.. raw:: html

<div id="insert_before/3"> </div>

.. index:: insert_before/3
.. _zipperp/0::insert_before/3:

``insert_before/3``
^^^^^^^^^^^^^^^^^^^

Inserts an element before the current one.

| **Compilation flags:**
| ``static``

| **Template:**
| ``insert_before(Zipper,Element,NewZipper)``
| **Mode and number of proofs:**
| ``insert_before(+zipper,?term,--zipper)`` - ``zero_or_one``


.. raw:: html

<div id="insert_after/3"> </div>

.. index:: insert_after/3
.. _zipperp/0::insert_after/3:

``insert_after/3``
^^^^^^^^^^^^^^^^^^

Inserts an element after the current one.

| **Compilation flags:**
| ``static``

| **Template:**
| ``insert_after(Zipper,Element,NewZipper)``
| **Mode and number of proofs:**
| ``insert_after(+zipper,?term,--zipper)`` - ``zero_or_one``


.. raw:: html

<div id="replace/3"> </div>
@@ -210,49 +252,70 @@ Replaces the current element with a new element.
| **Template:**
| ``replace(Zipper,NewCurrent,NewZipper)``
| **Mode and number of proofs:**
| ``replace(+zipper,?term,?zipper)`` - ``one``
| ``replace(+zipper,?term,--zipper)`` - ``one``


.. raw:: html

<div id="insert_before/3"> </div>
<div id="delete_and_previous/2"> </div>

.. index:: insert_before/3
.. _zipperp/0::insert_before/3:
.. index:: delete_and_previous/2
.. _zipperp/0::delete_and_previous/2:

``insert_before/3``
^^^^^^^^^^^^^^^^^^^
``delete_and_previous/2``
^^^^^^^^^^^^^^^^^^^^^^^^^

Inserts an element before the current one.
Deletes the current element and moves to the previous element. Fails if no previous element exists.

| **Compilation flags:**
| ``static``

| **Template:**
| ``insert_before(Zipper,Element,NewZipper)``
| ``delete_and_previous(Zipper,NewZipper)``
| **Mode and number of proofs:**
| ``insert_before(+zipper,?term,?zipper)`` - ``zero_or_one``
| ``delete_and_previous(+zipper,--zipper)`` - ``zero_or_one``


.. raw:: html

<div id="insert_after/3"> </div>
<div id="delete_and_next/2"> </div>

.. index:: insert_after/3
.. _zipperp/0::insert_after/3:
.. index:: delete_and_next/2
.. _zipperp/0::delete_and_next/2:

``insert_after/3``
^^^^^^^^^^^^^^^^^^
``delete_and_next/2``
^^^^^^^^^^^^^^^^^^^^^

Inserts an element after the current one.
Deletes the current element and moves to the next element. Fails if no next element exists.

| **Compilation flags:**
| ``static``

| **Template:**
| ``insert_after(Zipper,Element,NewZipper)``
| ``delete_and_next(Zipper,NewZipper)``
| **Mode and number of proofs:**
| ``delete_and_next(+zipper,--zipper)`` - ``zero_or_one``


.. raw:: html

<div id="delete_and_unzip/2"> </div>

.. index:: delete_and_unzip/2
.. _zipperp/0::delete_and_unzip/2:

``delete_and_unzip/2``
^^^^^^^^^^^^^^^^^^^^^^

Deletes the current element and removes the zipper returning the resulting sequence.

| **Compilation flags:**
| ``static``

| **Template:**
| ``delete_and_unzip(Zipper,Sequence)``
| **Mode and number of proofs:**
| ``insert_after(+zipper,?term,?zipper)`` - ``zero_or_one``
| ``delete_and_unzip(+zipper,--sequence)`` - ``one``


Protected interface
@@ -6,7 +6,7 @@
``zlist``
=========

Zipper list predicates.
Zipper list predicates. Zippers should be regarded as opaque terms.

| **Author:** Paulo Moura
| **Version:** 0.1
@@ -672,10 +672,16 @@ <h2 id="D">D</h2>
</li>
<li><a href="dictionaryp_0.html#index-6">delete/4</a>, <a href="heapp_0.html#index-3">[1]</a>
</li>
<li><a href="osp_0.html#index-9">delete_directory/1</a>
<li><a href="zipperp_0.html#index-13">delete_and_next/2</a>
</li>
<li><a href="zipperp_0.html#index-12">delete_and_previous/2</a>
</li>
<li><a href="zipperp_0.html#index-14">delete_and_unzip/2</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="osp_0.html#index-9">delete_directory/1</a>
</li>
<li><a href="osp_0.html#index-20">delete_file/1</a>
</li>
<li><a href="listp_0.html#index-4">delete_matches/3</a>
@@ -1118,11 +1124,11 @@ <h2 id="I">I</h2>
</li>
<li><a href="dictionaryp_0.html#index-5">insert/4</a>, <a href="heapp_0.html#index-1">[1]</a>
</li>
<li><a href="zipperp_0.html#index-11">insert_after/3</a>
<li><a href="zipperp_0.html#index-10">insert_after/3</a>
</li>
<li><a href="heapp_0.html#index-2">insert_all/3</a>, <a href="setp_0.html#index-8">[1]</a>
</li>
<li><a href="zipperp_0.html#index-10">insert_before/3</a>
<li><a href="zipperp_0.html#index-9">insert_before/3</a>
</li>
<li><a href="class_hierarchyp_0.html#index-3">instance/1</a>
</li>
@@ -1926,7 +1932,7 @@ <h2 id="R">R</h2>
</li>
<li><a href="osp_0.html#index-19">rename_file/2</a>
</li>
<li><a href="zipperp_0.html#index-9">replace/3</a>
<li><a href="zipperp_0.html#index-11">replace/3</a>
</li>
<li><a href="atom_0.html#index-1">replace_sub_atom/4</a>
</li>
@@ -1248,6 +1248,15 @@ <h1>Logtalk APIs<a class="headerlink" href="#logtalk-apis" title="Permalink to t
<li class="toctree-l2"><a class="reference internal" href="predicate_index.html#delete-4"><code class="docutils literal notranslate"><span class="pre">delete/4</span></code></a><ul class="simple">
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="predicate_index.html#delete-and-next-2"><code class="docutils literal notranslate"><span class="pre">delete_and_next/2</span></code></a><ul class="simple">
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="predicate_index.html#delete-and-previous-2"><code class="docutils literal notranslate"><span class="pre">delete_and_previous/2</span></code></a><ul class="simple">
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="predicate_index.html#delete-and-unzip-2"><code class="docutils literal notranslate"><span class="pre">delete_and_unzip/2</span></code></a><ul class="simple">
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="predicate_index.html#delete-directory-1"><code class="docutils literal notranslate"><span class="pre">delete_directory/1</span></code></a><ul class="simple">
</ul>
</li>
@@ -2741,7 +2750,7 @@ <h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Pe
<li><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></li>
<li><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></li>
</ul>
<p>Generated on Fri Jan 11 14:15:55 WET 2019</p>
<p>Generated on Fri Jan 11 15:27:16 WET 2019</p>
</div>


Oops, something went wrong.

0 comments on commit c34def0

Please sign in to comment.