This is surely more “Prolog like”. It is probably also faster for (very) short strings. On long strings using the NULL stream is much faster and uses no extra resources. The Quintus derived null stream is like Unix /dev/null implemented to either discard output or use the stream position information.
jan
22
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Byte ordering/conversion predicates? | 10 | 1632 | September 5, 2021 | |
| Write IEEE 754 floats in binary stream | 13 | 296 | December 5, 2023 | |
| Read_string/3 counts code points, right? | 5 | 527 | January 28, 2022 | |
| Read a number of bytes from a stream | 2 | 303 | October 2, 2023 | |
| Raw to byte or character conversion | 23 | 1429 | July 18, 2022 |