# Ann: SWI-Prolog 8.5.12

**URL:** <https://swi-prolog.discourse.group/t/ann-swi-prolog-8-5-12/5451>\
**Category:** Releases\
**Created:** [June 2, 2022, 9:42am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-8-5-12/5451 "2022-06-02T09:42:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [June 2, 2022, 9:42am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-8-5-12/5451/1 "2022-06-02T09:42:39Z")

</div>

Dear SWI-Prolog user,

SWI-Prolog 8.5.12 is ready for download. This release mainly provides  
fixes and small additions contributed by several people. Thanks!  
Highlights:

- @oskardrums added support for _breakpoint conditions_. This is  
now available through PceEmacs: select a breakpoint and use the  
menu item Prolog/Set breakpoint condition. You can set conditions  
from the console using [set\_breakpoint\_condition/2](https://www.swi-prolog.org/pldoc/doc_for?object=prolog_breakpoints%3Aset_breakpoint_condition/2).
- @peter.ludemann added more tests some fixes. Peter started work  
cleaning up library(archive) memory management.
- @ridgeworks provided some more updates on floating point arithmetic.
- @mgondan1 added more build support using the R build toolchain.
- There is a new flag `agc_close_streams` that is currently disabled  
by default. When enabled, the atom garbage collector closes streams  
whose handle is being garbage collected. This is experimental and  
likely to become the default when proven robust.

Lots of small things have been enhanced, both to the system and docs.

```
Enjoy --- Jan

```

# SWI-Prolog Changelog since version 8.5.11

- FIXED: Issue#993: possible deadlock when loading a module. Reported by  
Sean Leather.

- FIXED: eliminated a spurious choice-point in sub\_atom/5 Reported in  
[https://swi-prolog.discourse.group/t/careful-with-sub-atom-5-and-feature-request-last-sub-atom-5/5422](https://swi-prolog.discourse.group/t/careful-with-sub-atom-5-and-feature-request-last-sub-atom-5/5422)

- FIXED: Sfprintf(): handling of ENC\_WCHAR() encoding.

- ENHANCED: Sfprintf(): allow Unicode characters for `%c`

- FIXED: PL\_cleanup(): small memory leak for command line options.  
Peter Ludemann.

- FIXED: correct arity of dynamic declaration for breakpoint\_condition/4

- DOC: enhance documentation for det/1, `$/1` and `$/0`, describing the  
exceptions and how trap/1 can be used to make the debugger act quickly.

- ADDED: [set\_breakpoint\_condition/2](https://www.swi-prolog.org/pldoc/doc_for?object=prolog_breakpoints%3Aset_breakpoint_condition/2), providing _conditional breakpoints_

- MODIFIED: Extend prolog:break\_hook/6 to prolog:break\_hook/7 …  
..adding an extra boolean argument `+Debug` denoting whether the  
system was in debug mode when the breakpoint was triggered.

- FIXED: explain/1: hide references from prolog\_xref:called/5

- FIXED: Have breakpoints cleared in the UI when the clause that holds  
them is removed during a reload of the file.

- FIXED: [breakpoint\_property/2](https://www.swi-prolog.org/pldoc/doc_for?object=prolog_breakpoints%3Abreakpoint_property/2): fixed `character_range` property

- ENHANCED: Issue#17: reverse/2 to be deterministic if second argument  
is a proper list. Ulrich Neumerkel.

- TEST: Added STO restriction as this test involves rational trees.

- FIXED: Issue#122: dif/2: or-node simplification.

- FIXED: Possible deadlock enumerating predicates from a source file.

- TEST: Updated `^/2` tests. Move float\*\*rat tests to test\_ieee754  
for rounding mode handling.

- ENHANCED: use ldexp() rather than pow() for multiplying a float with  
an integral power of 2. mpz\_fdiv(): replace calls to pow() function  
by ldexp()

- FIXED: rounding of pow() (`^/2` and `**/2`) ar\_pow(): Re-implement  
float\*\*mpq case

- FIXED: Avoid Unicode quote in library(aggregate) comment

- ADDED: Prolog flag `acg_close_streams`.

- ADDED: Sgcclose() as an extended version of Sclose() that can be  
used to avoid deadlocks when closing streams from the atom garbage  
collector.

- MODIFIED: PL\_blob\_data() to return NULL if the blob has been released  
and document the consequences thereof.

- PORT: Replace MINGW\_ROOT by WIN32 I think -municode needs to be defined  
on all Windows systems that are currently supported (= several flavors  
of MinGW). MINGW\_ROOT was not defined on my system, so I would like  
to change this to WIN32 to save a cmake command line switch.

- FIXED: LaTeX conflict preventing building the PDF docs

## Package archive

- FIXED: Allow an open archive to be garbage collected.

- CLEANUP: Renamed internal functions to make it clearer which  
context they’re called in - added internal documentation about  
the state transitions - added AR\_ERROR state (renamed AR\_OPENED  
to AR\_OPENED\_ARCHIVE) - added archive\_wrapper\_init\_value for  
initializing the blob - removed a double-free (ar-\>entry in read  
mode)

## Package cpp

- TEST: Add Unicode/wchar tests

- TEST: PL\_atom\_wchars print

## Package http

- ADDED: http\_open/3: option raw\_encoding(+Encoding) to prevent deconding  
certain (transfer) encodings.

- ADDED: http\_open/3: option raw\_headers(-Strings) to get access to  
the unparsed HTTP header as a list of strings.

- ADDED: http\_post\_data/3: support string(String) and string(Type,  
String) simlar to atom(String) and atom(Type, String). Avoids creating  
a potentially large garbage atom.

## Package pcre

- TEST: Add Unicode\>0xffff test

## Package pldoc

- MODIFIED: when creating a link from a URL, do not include a punctuation  
character before a space. So, `http://example.com/home.html. Bla`  
correctly links to the html page.

## Package sgml

- FIXED: Avoid illegal access to local variable (harmless)

## Package ssl

- PORT: RTools42, link order for OS libs, add libz

- BUILD: Ensure HOME is set to a writable path for generating the SSL  
test certificates.

## Package xpce

- FIXED: PceEmacs Prolog/spy and Prolog/trace menu items to deal with  
SSU (=\>) rules and fix DCG (–\>) rules.

- ADDED: PceEmacs: Prolog mode command **Set breakpoint condition**.
