For the terminus-store prolog binding, we’ve defined a bunch of custom blob types. Each of them has a proper write function defined (see https://github.com/terminusdb/terminus_store_prolog/blob/c60e785020c048b05d57f8c9e74d4af1756e8f33/c/blobs.c).
But now, see the following:
?- open_directory_store('/tmp/foo', Store). Store = #<store_blob> . ?- writ($Store). Correct to: "write(������������������⤾"? yes #<store_blob> Store = #<store_blob> .
For some reason, DWIM is trying to represent our blob as this weird sequence of characters that is definitely not coming out of our write function.
I thought maybe there’d be a bug with representing blob types in DWIM, but it looks like streams work just fine:
?- open_null_stream(Stream). Stream = <stream>(0x55bb577df170). ?- writ($Stream). Correct to: "write(<stream>(0x55bb577df170))"? yes <stream>(0x55bb577df170) Stream = <stream>(0x55bb577df170).
Am I doing something wrong in my blob definitions?
All this is with swipl 8.0.3.