Commit Graph

2152 Commits

Author SHA1 Message Date
Markus Triska
2d1f182c49 FIXED: instantiation errors for type(Var) in open/4 options
This addresses #1030.
2021-11-08 22:37:46 +01:00
Markus Triska
0677f51717 add motivation and comments about library(pio) predicates 2021-11-08 22:18:30 +01:00
Markus Triska
a9bfeb0e96 use newly available library predicate read_n_chars/3 2021-11-08 21:51:03 +01:00
Markus Triska
c44d27fb7f mention pure output predicates in the README 2021-11-08 20:29:39 +01:00
Markus Triska
a0a01b8ba7 ADDED: library(format): DCG nonterminal portray_clause_//1, in analogy to format_//2. 2021-11-07 17:47:05 +01:00
Markus Triska
e32215e19a express format/3 and portray_clause/2 in terms of phrase_to_stream/2 2021-11-07 17:47:05 +01:00
Markus Triska
893fb0e3cc ADDED: phrase_to_stream/2, writing a list of characters to a stream. 2021-11-07 17:44:45 +01:00
Mark Thom
1d2a838717 Merge pull request #1077 from pmoura/fix_get_code_predicates_at_end_of_file
Fix the get_code/1-2 predicates to return -1 at the end of stream as per standard
2021-11-07 09:40:29 -05:00
Mark Thom
8457a19792 Merge pull request #1071 from triska/read_n_chars
ADDED: read_n_chars/3, reading N characters from a stream.
2021-11-07 09:40:03 -05:00
Mark Thom
0b2638b201 Merge pull request #1070 from triska/open_stream
ENHANCED: open/4 to allow opening a stream by specifying stream(S).
2021-11-07 09:39:41 -05:00
Mark Thom
4dce57a1b6 Merge pull request #1069 from triska/crypto_improvements
Performance improvements for library(crypto)
2021-11-07 09:39:13 -05:00
Paulo Moura
658b835a70 Fix the get_code/1-2 predicates to return -1 at the end of stream 2021-11-06 19:41:25 +00:00
Markus Triska
52af955463 import also partial_string/3 (used in #1071) 2021-11-04 18:50:40 +01:00
Markus Triska
09e886db0b ADDED: read_n_chars/3, reading N characters from a stream. 2021-11-04 18:36:27 +01:00
Markus Triska
f668640e3d move error handling to Prolog by using the new '$first_non_octet'/2 2021-11-04 18:35:22 +01:00
Markus Triska
afcd44deaa ENHANCED: open/4 to allow opening a stream by specifying stream(S).
This allows switching standard output to binary, using for example:

  ?- current_output(S0), open(stream(S0), write, S, [type(binary)]).

format/3 can then be used to write binary data to S. This is needed
for example when piping binary data to other programs.

This addresses #614, please read the discussion for more information.

The current implementation is very preliminary: Specifically, it works
by destructively modifiying the parameters of the underlying stream,
making it no longer usable in its original mode. Currently, if the
type of standard output is set to binary, then the toplevel no longer
works. Therefore, after writing binary output to standard output,
the program should either halt, or set the stream type back to text.
2021-11-04 18:33:40 +01:00
Markus Triska
8c8c21c63b use partial_string/1 for much quicker test 2021-11-04 00:12:00 +01:00
Markus Triska
55dabbe16a use '$first_non_octet'/2 for much faster domain check 2021-11-04 00:12:08 +01:00
Markus Triska
494bd7b79c ADDED: '$first_non_octet'/2, for much more efficient domain checks in library(crypto).
'$first_non_octet'(Cs, C) <=> C is the leftmost character in the
string Cs whose character code is not in 0..255.
2021-11-04 00:12:00 +01:00
Markus Triska
320ee072e6 ENHANCED: Much faster Base64 encoding/decoding, using partial_string/1 for a quick check. 2021-11-03 22:07:20 +01:00
Mark Thom
67ef5fe8e6 Merge pull request #1065 from aarroyoc/pio-string
Disable check of atom and leverage to open/4 the domain_error
2021-11-03 13:27:45 -02:30
Mark Thom
7c5c700bb8 Merge pull request #1066 from aarroyoc/rust-2021
Rust 2021
2021-11-03 13:27:18 -02:30
Adrián Arroyo Calle
dd51908439 Rust 2021 2021-11-01 23:03:51 +01:00
Adrián Arroyo Calle
6a0f638d40 Disable check of atom and leverage to open/4 the domain_error 2021-10-29 23:52:08 +02:00
Adrián Arroyo Calle
2480c6633c Disable check of atom and leverage to open/4 the domain_error 2021-10-29 23:51:30 +02:00
Mark Thom
ca62e54652 Merge pull request #1052 from aarroyoc/shell-predicate
Implement shell/1 and shell/2
2021-10-17 11:58:28 -06:00
Adrián Arroyo Calle
44dd9ae9fb Go back and accept only list of chars 2021-10-15 17:22:15 +02:00
Adrián Arroyo Calle
3f4d62952a Accept atom or shell 2021-10-14 22:52:29 +02:00
Adrián Arroyo Calle
391cda919f Implement shell/1 and shell/2 2021-10-11 22:35:05 +02:00
Mark Thom
44fc61ed86 Merge pull request #1051 from aarroyoc/close-stream
Throw exception if closing a closed TCP stream #1046
2021-10-07 17:09:16 -06:00
Adrián Arroyo Calle
f70685d53c Close Stream test feedback 2021-09-30 23:46:52 +02:00
Adrián Arroyo Calle
807abfef4f Close Stream bug files 2021-09-30 23:01:25 +02:00
Adrián Arroyo Calle
810d4c51f9 Close Stream bug files 2021-09-30 22:59:15 +02:00
Mark Thom
1a0684cd20 Merge pull request #1049 from pmoura/add_preliminary_current_module_predicate_definition
Add preliminary current_module/1 predicate definition requiring a bound argument
2021-09-30 09:19:09 -06:00
Adrián Arroyo Calle
47d811c250 use shutdown error values to throw exceptions in close stream 2021-09-30 00:10:03 +02:00
Adrián Arroyo Calle
4d0998ef72 launch exception if closing a closed TCP stream #1046 2021-09-28 22:48:51 +02:00
Mark Thom
5d2b0377d8 reset attributed variables queue when backtracking (#678, etc.) 2021-09-27 19:12:24 -06:00
Mark Thom
f6d69b6051 reset attributed variables queue after successful verify_attributes interrupt (#669, etc) 2021-09-26 18:58:00 -06:00
Paulo Moura
490496f381 Add preliminary current_module/1 predicate definition requiring a bound argument 2021-09-24 10:13:00 +01:00
Mark Thom
bc4f719931 Merge pull request #1045 from triska/phrase_to_file
ADDED: Rudimentary version of phrase_to_file/2 in library(pio)
2021-09-05 23:31:57 -06:00
Markus Triska
ded4a75b9c use round brackets for meta_predicate declarations
This is because meta_predicate is not a standard operator.
2021-09-04 22:02:17 +02:00
Markus Triska
9e75eb35a0 ADDED: Rudimentary version of phrase_to_file/2 in library(pio)
See #691 for more information.
2021-09-04 21:13:51 +02:00
Mark Thom
326fb99849 Merge pull request #1033 from aarroyoc/fix-1022
Add a -f switch to load alternative initialization files
2021-08-23 22:26:15 -06:00
Mark Thom
fe1ced9f58 Merge pull request #1032 from aarroyoc/fix-1009
Fix #1009 by providing a naive num-bigint implementation of count_ones
2021-08-23 22:25:44 -06:00
Adrián Arroyo Calle
00d0502cbd Rename init_file to disable_init_file 2021-08-23 09:53:15 +02:00
Adrián Arroyo Calle
c30bd51b91 use consult instead of use_module 2021-08-22 11:44:17 +02:00
Adrián Arroyo Calle
9391dd9d51 Rename to disable_init_file and change description 2021-08-22 11:36:27 +02:00
Adrián Arroyo Calle
3cd112b60f PR feedback 2021-08-21 17:53:20 +02:00
Adrián Arroyo Calle
dce0c43e26 Read scryerrc if goals specified but not -f specified 2021-08-20 14:15:16 +02:00
Adrián Arroyo Calle
80e228f236 Clean the code 2021-08-20 14:06:57 +02:00