Loosely related, since S is a string in the example below. Note that S ends up being empty:
?- with_output_to(string(S), license).
% SWI-Prolog is covered by the Simplified BSD license:
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions
% additional conditions. These components are:
S = "".
Is this a feature or a bug? I guess it has to do with print_message printing to user_error.
The name of the library is obviously misleading. library(streams) suggests that it’s been there since the 1980ies, with their tell/1, told/0, you name it One would really not expect to find it only in the recent swipl-devel.
You’d preferred “new_streams” I think the name is fine. Stream handling is mostly built-in. This library is about more high level stream operations. Having a library with a single predicate is a bit of an overkill. We’ll see where it goes.