Donate
Sandbox
Collaborate
Documentation
Downloads
Documentation
Prolog Predicate Reference
lists
last/2
last/2
Last element of a list.
Description
last
(
?list
,
?last
)
last(List, Last)
is true if and only if
Last
is the last element on the list
List
.
Examples
Example #1
Example of last/2
?- last([1,2,3], 3). % true. ?- last([1,2,3], 4). % false. ?- last(List, 3). % List = [3] ; % List = [_2, 3] ; % List = [_2, _6, 3] ; % List = [_2, _6, _10, 3] ; % ... ?- last([1,2,3], Last) % Last = 3.
Implementation
Community
Site
Twitter
Github
npm
Documentation
Manual
Examples
Implementation details
Prolog Predicate Reference
Code
Custom bundle
Installation from npm
Source Code
Contact
Form contact
Collaborators
Contributors
tau.prolog @ gmail.com
© 2017 - 2024
José Antonio Riaza Valverde
Released under the
BSD-3 Clause license