Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid a spurious steadfasness warning in the library list object
  • Loading branch information
pmoura committed Mar 15, 2019
1 parent 4ad431d commit 5afc28c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/_sources/index.rst.txt
Expand Up @@ -17,4 +17,4 @@ Indices and tables
* :ref:`genindex`
* :ref:`search`

Generated on Wed Mar 13 11:51:19 WET 2019
Generated on Fri Mar 15 14:59:37 WET 2019
4 changes: 2 additions & 2 deletions docs/_sources/list_0.rst.txt
Expand Up @@ -9,8 +9,8 @@
List predicates.

| **Author:** Paulo Moura
| **Version:** 2.17
| **Date:** 2019/3/6
| **Version:** 2.18
| **Date:** 2019/3/15
| **Compilation flags:**
| ``static, context_switching_calls``
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Expand Up @@ -2860,7 +2860,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 Wed Mar 13 11:51:19 WET 2019</p>
<p>Generated on Fri Mar 15 14:59:37 WET 2019</p>
</div>


Expand Down
4 changes: 2 additions & 2 deletions docs/list_0.html
Expand Up @@ -313,8 +313,8 @@ <h1><code class="docutils literal notranslate"><span class="pre">list</span></co
<p>List predicates.</p>
<div class="line-block">
<div class="line"><strong>Author:</strong> Paulo Moura</div>
<div class="line"><strong>Version:</strong> 2.17</div>
<div class="line"><strong>Date:</strong> 2019/3/6</div>
<div class="line"><strong>Version:</strong> 2.18</div>
<div class="line"><strong>Date:</strong> 2019/3/15</div>
</div>
<div class="line-block">
<div class="line"><strong>Compilation flags:</strong></div>
Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions library/list.lgt
Expand Up @@ -23,9 +23,9 @@
extends(compound)).

:- info([
version is 2.17,
version is 2.18,
author is 'Paulo Moura',
date is 2019/03/06,
date is 2019/03/15,
comment is 'List predicates.',
see_also is [list(_), numberlist, varlist, difflist],
remarks is [
Expand Down Expand Up @@ -597,15 +597,17 @@
; type_error(list, Term)
).

take(0, _, []) :-
!.
take(0, _, Elements) :-
!,
Elements = [].
take(N, [Element| Tail], [Element| Elements]) :-
N > 0,
M is N - 1,
take(M, Tail, Elements).

drop(0, List, List) :-
!.
drop(0, List, Remaining) :-
!,
Remaining = List.
drop(N, [_| Tail], Remaining) :-
N > 0,
M is N - 1,
Expand Down

0 comments on commit 5afc28c

Please sign in to comment.