XIO

xWire

Posts from every feed QUEST has found across the web — blogs, news, podcasts, channels and more.

SWI-Prolog - Latest topics

Latest topics

Xml_write to a zipfile

I want to write an xml to a zip file, this is what I tried: zip_open("new.zip", write, Z, []), zipper_open_new_file_in_zip(Z, "imsmanifest.xml", S, []), xml_write(S, element(elem, [], []), []), close(S), close(Z). An error is raised on the encoding: Call: (15) sgml_write:xml_write(<stream>(000002284659f7e0), element(elem, [], []), []) ? skip ERROR: Domain error: `xml_encoding' expected, found `octet' Can I specify this somewhere? 7 posts - 2 participants Read full topic

Break_hook/7

Playing around with breakpoints I added this hook definition and test code: prolog:break_hook(Clause, PC, FR, BFR, Expression, Debug, Action) :- writeln(user_error, break_hook(Clause, PC, FR, BFR, Expression, Debug)), Action = continue. test :- writeln(egg). I added a break point with Ctrl-c b: I expected the break_hook to write the break point context to user_error but it brought up the graphical tracer and waited for input. Thinking it might just be graphical tracer I turned it off, but the…

Term_factorized/3 error for compound_name_arity zero term

I happened to find a bug (?) on compound_name_arity zero terms in ‘term_facotized/3’. % ?- term_factorized(f(q()), S, E). %@ S = f(q()), %@ E = []. % ?- term_factorized(f(q(), q()), S, E). %@ ERROR: Domain error: `compound_non_zero_arity' expected, found `q()' %@ ERROR: In: %@ ERROR: [14] functor(q(),_7688,_7690) %@ ERROR: [13] terms:mk_subst([... - _7738],[_7748=_7750|_7744],t(black('',_7762,_7764,''),black(...,...,_7774,...))) at /Users/cantor/lib/swipl/library/terms.pl:309 %@ ERROR: [11]…

Epilog console freeze on dragging scroll bar track

Maybe you are not supposed to drag the scroll bar track, but this happens accidentally and freezes the console. SWI-Prolog 10.0.2 swipl-win.exe Windows 11 Pro 25H2 Build 26200.9168 Reproducible: Produce enough output to enable scrolling. Move mouse to scrollbar track (not the thumb). Press left mouse button on the track. Drag while holding the button. Result: The console window freezes. Not affected: mouse wheel dragging the thumb cleanly clicking the track or arrows 3 posts - 2 participants…

Http_date: RFC 9110 HTTP dates as one DCG that both parses and formats

I ported http-date-rs to SWI-prolog as an exercise and the result was useful enough to be worth packaging. RFC 9110 allows three date formats: IMF-fixdate, RFC 850 and asctime. The Rust version has a decoder (a Decoder struct with a position, expect/byte_at, a method per field) and a separate encoder built from format! calls. Two tables of month names pointing in opposite directions, and a fuzz target whose job is to catch them disagreeing. The Prolog version is one grammar:…

Atom_json_dict/3 options are not as documented

atom_json_dict(-Text, +JSONDict, +Options) Convert between textual representation and a JSON term represented as a dict. Options are as for json_read/3. json_read(+Stream, -Term, +Options) The following options are processed: … null(+NullTerm) Term used to represent JSON null. Default @(null) true(+TrueTerm) Term used to represent JSON true. Default @(true) false(+FalseTerm) Term used to represent JSON false. Default @(false) But defaults as documented don’t seem to be active: 159 ?-…