Skip to content

v0.13.0

Choose a tag to compare

@github-actions github-actions released this 25 Sep 17:46
· 94 commits to main since this release

Added

  • call_nth/2 and countall/2, the last two predicates of the Prolog prologue.
    call_nth(Goal, Nth) counts the solutions of Goal and, with Nth bound, stops at that
    solution without leaving a choice point; call_nth(Goal, 0) fails without calling Goal.
    countall(Goal, N) counts every solution without collecting them. Both raise
    type_error(integer, N) and domain_error(not_less_than_zero, N) for a bad count, and
    countall/2 the instantiation and callable errors for its goal first.
  • maplist/6..8, nth0/4, and nth1/4, which the prologue also lists; the /4 forms give the
    list without the element.

Fixed

  • succ/2 raises domain_error(not_less_than_zero, N) for a negative argument, rather than
    type_error(not_less_than_zero, N), and checks both arguments in the prologue's order, so
    succ(1, 1+1) is type_error(integer, 1+1).
  • nth0/3 and nth1/3 raise type_error(integer, I) for an index that is not an integer, which
    used to enumerate the list without end on a partial one, and domain_error(not_less_than_zero, I)
    for a negative index, which used to fail.