Commit Graph

2189 Commits

Author SHA1 Message Date
Markus Triska
1647e67dd4 ENHANCED: Support '_' followed by layout text sequence in integers.
This is handy for writing large integers, for example in cryptographic
applications.

This addresses #994.

Examples:

    ?- X = 1_000_000.
    %@    X = 1000000.

    ?- X = 1_
    000_
    000.
    %@    X = 1000000.
2021-11-27 10:09:39 +01:00
Mark Thom
ca28f24e42 Merge pull request #1107 from triska/fast_chars_test
New type tests: must_be(chars, ...) and can_be(chars, ...)
2021-11-25 19:01:03 -05:00
Markus Triska
0d4c38138a use newly available must_be(chars, ...) for fast string tests 2021-11-22 20:00:06 +01:00
Markus Triska
fe291e90f0 use newly available must_be(chars, ...) for fast string tests 2021-11-22 19:58:36 +01:00
Markus Triska
220e1e8d83 ADDED: must_be(chars, ...) and can_be(chars, ...) for string tests.
Internal features of Scryer Prolog are used to make these tests fast.
2021-11-22 19:55:34 +01:00
Mark Thom
2c0fb3adb0 Merge pull request #1098 from triska/format_improvements
Various smaller improvements to library(format)
2021-11-21 15:28:32 -05:00
Mark Thom
b851eefb03 Merge pull request #1099 from aarroyoc/uninstantiation_error-missing
Fix uninstantiation_error missing. Fix #1031
2021-11-21 15:27:38 -05:00
Mark Thom
eaad2d8b1f Merge pull request #1100 from aarroyoc/phrase-to-file-options
Add phrase_to_file/3 (phrase_to_file with Options)
2021-11-21 15:27:17 -05:00
Mark Thom
575d235296 Merge pull request #1102 from triska/meta_predicate_corrections
Meta predicate corrections
2021-11-21 15:27:03 -05:00
Markus Triska
faf74519dc use round brackets for meta_predicate/1 declaration 2021-11-20 22:43:53 +01:00
Markus Triska
66becaf91c FIXED: meta_predicate/1 declaration of cond_t/3. 2021-11-20 22:43:33 +01:00
Markus Triska
6610ba67c4 FIXED: meta_predicate/1 declaration of (',')/3 and (;)/3. 2021-11-20 22:43:07 +01:00
Markus Triska
e05dd5ebb5 FIXED: meta_predicate/1 declaration for tfilter/3. 2021-11-20 22:39:38 +01:00
Markus Triska
cf77f29988 FIXED: meta_predicate/1 declaration for tmember_t/3. 2021-11-20 22:38:27 +01:00
Markus Triska
2be8ed886b FIXED: meta_predicate/1 declaration for tmember/2. 2021-11-20 22:37:59 +01:00
Markus Triska
21e5b0ab52 FIXED: meta_predicate/1 declaration for tpartition/4.
This addresses #1101.
2021-11-20 22:37:31 +01:00
Markus Triska
d72cb74ffa mention phrase_to_file/3 which is being prepared in #1100 2021-11-17 21:33:15 +01:00
Markus Triska
3c988d555f 'f' --> f 2021-11-17 21:20:40 +01:00
Markus Triska
5981a65cc2 better layout 2021-11-17 21:20:40 +01:00
Markus Triska
9900762747 use newly available seq//1 from library(dcgs)
I am using seq(Ls) instead of plain Ls so that DCGs can be debugged
declaratively, by generalizing away nonterminals in rules.
2021-11-17 21:20:40 +01:00
Adrián Arroyo Calle
0db2ca6659 Fix mistake in phrase_to_file/2 definition 2021-11-17 08:36:39 +01:00
Adrián Arroyo Calle
8e68626f14 Add phrase_to_file/3 (phrase_to_file with Options) 2021-11-16 23:54:04 +01:00
Adrián Arroyo Calle
72a88d1f91 Fix uninstantiation_error missing. Fix #1031 2021-11-16 23:22:24 +01:00
Markus Triska
bd75e9c184 more elegant solution for parsing numeric arguments, using a DCG 2021-11-16 18:25:35 +01:00
Markus Triska
23df16ecf9 mention the format("~s", [Ls]) pattern and new library(pio) predicates 2021-11-16 18:20:58 +01:00
Mark Thom
75b01d5021 Merge pull request #1082 from pmoura/fix_format_predicates_missing_numbervars_option_on_w_and_q_formats
Fix the format/2-3 predicates missing the numbervars(true) option in the ~w and ~q formats
2021-11-13 00:05:26 -05:00
Mark Thom
b7fa5db570 Merge pull request #1087 from Skgland/fix_beta_check
fix failing lint warnings in beta build
2021-11-13 00:04:51 -05:00
Mark Thom
297f126f66 Merge pull request #1078 from triska/pio_improvements
Various improvements for pure output
2021-11-13 00:03:57 -05:00
Mark Thom
bd6400f17f Merge pull request #1086 from Skgland/pass_-f_flag_in_cargo_test
pass -f to scryer-prolog in cargo test so that we ignore .scryerrc
2021-11-13 00:03:38 -05:00
Mark Thom
21e55023a4 Merge pull request #1088 from triska/call_nth_metapredicate
FIXED: meta_predicate/1 directive for call_nth/2.
2021-11-13 00:03:26 -05:00
Skgland
49e024bdd8 remove unused fields instead, prompting more dead_code removal 2021-11-11 19:32:35 +01:00
Markus Triska
57877107d8 use functional notation for all meta_predicate/1 directives 2021-11-11 19:29:32 +01:00
Markus Triska
e9b4a99c8f FIXED: meta_predicate/1 directive for call_nth/2.
This addresses #1021.
2021-11-11 19:26:27 +01:00
Skgland
7bc4876071 fix failing lint warnings in beta build 2021-11-11 18:53:08 +01:00
Skgland
e7899ee15e pass -f to scryer-prolog in cargo test so that we ignore .scryerrc
fixes issue #1085
2021-11-11 11:37:05 +01:00
Paulo Moura
7ea20d9ce9 Fix the format/2-3 predicates missing the numbervars(true) option in the ~w and ~q formats 2021-11-08 22:00:02 +00:00
Markus Triska
3045f327d5 FIXED: instantiation errors for alias(Var) in open/4 options
This addresses #1030.
2021-11-08 22:41:04 +01:00
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