Commit Graph

3151 Commits

Author SHA1 Message Date
Mark
24450a8827 use ExitCode when halting so Drop is called, close terminal stream in rustyline Drop 2023-07-22 19:06:13 -06:00
Mark Thom
57e8ed65b0 Merge pull request #1050 from pmoura/add_float_integer_part_and_float_fractional_part_standard_functions
WIP: Add float_integer_part/1 and float_fractional_part/1 standard arithmetic functions
2023-07-22 13:48:16 -06:00
Mark
3f819e2dfd additional write fixes, use rustyline 12.0.0 (#1876, #1901) 2023-07-22 11:53:09 -06:00
Mark
9a7862c322 correct max_depth option (#1876) 2023-07-22 11:11:23 -06:00
Mark Thom
92c77cdff5 Merge pull request #1899 from triska/master
remove another !/0 which is now no longer necessary due to improved indexing
2023-07-21 23:26:20 -06:00
Markus Triska
554e956ef5 remove another !/0 which is now no longer necessary due to improved indexing 2023-07-22 06:52:29 +02:00
Mark
60d9d01a55 Merge branch 'add_float_integer_part_and_float_fractional_part_standard_functions' of https://github.com/pmoura/scryer-prolog into pmoura-add_float_integer_part_and_float_fractional_part_standard_functions 2023-07-21 15:35:28 -06:00
Mark
cb79552dd0 correct max_depth option (#1876) 2023-07-21 15:05:27 -06:00
Mark
f310ff24a5 remove now unnecessary cut in lists.pl 2023-07-21 11:35:57 -06:00
Nicolas Luck
b1963864d2 Explicitly dereference pointer to avoid calling neg() on reference 2023-07-21 17:07:40 +02:00
Fayeed Pawaskar
b4e7000eb2 Fixed missing functionality in dashu with their methods still has some issue with move 2023-07-21 14:21:32 +05:30
Mark
e529e7ba21 improve goal expansion and (',') interpretation error handling 2023-07-20 14:27:10 -06:00
Mark
1697cd5c7f add log10, hyperbolic tan and inverse hyperbolic tan functions (#1898) 2023-07-20 12:33:51 -06:00
Mark
dcd7360b17 add EMIT_NEWLINE to add newlines to readline input only after query terms begin to be read (#1074, #1897) 2023-07-20 09:39:06 -06:00
Mark
4fd247f881 check for unexpected EOF in get_to_eof (#1897) 2023-07-19 17:13:47 -06:00
Mark
85bc544fb9 dereference TermWriteResult variables sooner in read_term_body (#1894) 2023-07-18 15:39:51 -06:00
Mark
14646074be remove failing append choicepoint in atom_concat/3 special case (#1893) 2023-07-18 14:44:02 -06:00
Mark Thom
1ba040c24d Merge pull request #1885 from mthom/setof_bagof_fixes
Fix group_by_variants/4 and keysort in setof/3
2023-07-18 12:35:10 -06:00
Mark
56f6772422 call write_read_term_options if read_term_from_chars/3 succeeds by unifying Term to end_of_file (#1892) 2023-07-18 12:15:20 -06:00
Mark
db43d461b9 catch errors thrown from tabling Worker (#1526, #1888) 2023-07-18 12:10:27 -06:00
Mark
42a50474da remove read/{1,2} as a builtin, write read options upon EOF, throw better domain errors in parse_read_term_options/2 2023-07-17 16:45:03 -06:00
Mark
cf367024fd add specialized EOF handling for user input (#1892) 2023-07-17 14:38:26 -06:00
Mark
67d198ac77 Merge branch 'read_term_eof_changes' 2023-07-17 13:22:51 -06:00
Mark
a154a34f87 omit anonymous variables from read_term variable_names and singletons lists 2023-07-17 13:20:10 -06:00
Mark
86c90d77dd do a better job handling EOF in read_term (#1887) 2023-07-17 13:19:30 -06:00
Mark
4e1a4dae6c print strings in tails of lists (#1890) 2023-07-17 11:38:50 -06:00
Fayeed Pawaskar
cf345d8174 wip dashu move 2023-07-17 20:40:41 +05:30
Mark Thom
a18da368a1 Merge pull request #1891 from triska/initialization_goals
ENHANCED: use newly available read_term_from_chars/3 for better errors
2023-07-16 10:26:13 -06:00
Markus Triska
5d3295c40c ENHANCED: use newly available read_term_from_chars/3 for better errors
Examples, previously:

    $ scryer-prolog -g "member(X,Ls"
    ?-
    $ scryer-prolog -g "member(X,Ls)"
    member(_542,_543) causes: error(existence_error(procedure,member/2),member/2)
    ?-

Now:

    $ scryer-prolog -g "member(X,Ls"
    "member(X,Ls" cannot be read: error(syntax_error(incomplete_reduction),read_term_from_chars/3:0)
    $ scryer-prolog -g "member(X,Ls)"
    member(X,Ls) causes: error(existence_error(procedure,member/2),member/2)
    ?-

This also addresses #1185.
2023-07-16 14:16:07 +02:00
Mark
de10ccfdee re-factor options handling of read_term into read_term_body (#1887) 2023-07-15 21:52:54 -06:00
Mark
65a8ce8e22 generalize simple goal detection to fix call/N test failures in logtalk test suite 2023-07-15 19:29:06 -06:00
Mark
5a7da721cd add read_term_from_chars/3 (#637) 2023-07-15 11:20:20 -06:00
Mark
b234ef7ea3 use double_quotes in write_error (#1886) 2023-07-15 10:58:25 -06:00
Mark
617c961f88 add is_inbuilt check to err_on_builtin_overwrite (#1872) 2023-07-15 10:44:00 -06:00
Mark
e95355e56e eliminate call_with_inference_limit/3 leaks (#1300) 2023-07-15 10:22:23 -06:00
Mark
ff5e9a793b add unknown flag to set_prolog_flag and current_prolog_flag 2023-07-14 19:10:10 -06:00
Mark
101d0548db fix group_by_variants/4 and keysort in setof/3 (#1440, #1856) 2023-07-14 18:52:29 -06:00
Mark
b6a81c51ab add (:-)/1 and (:-)/2 to ClauseType::is_inbuilt (#1872) 2023-07-14 12:44:28 -06:00
Mark
ba2cd43144 fix assert(a|z)/1 errors 2023-07-13 17:12:17 -06:00
Mark Thom
bd720b49f3 Merge pull request #1884 from triska/countall
ADDED: countall/2, for compatibility with GNU Prolog.
2023-07-13 16:09:29 -06:00
Markus Triska
9590d5200c ADDED: countall/2, for compatibility with GNU Prolog.
Example:

    ?- countall(member(X, "abc"), N).
       N = 3.
2023-07-13 23:08:13 +02:00
Mark
12f890e4a2 throw permission_error in compile_assert when attempting to assert a built-in (#1872) 2023-07-13 15:03:26 -06:00
Mark
a9cb826bf3 arith_eval_by_metacall may receive a stack variable 2023-07-13 13:58:51 -06:00
Mark
4163cb038d correct peek_code/2, don't set stream position in peek functions 2023-07-13 13:37:34 -06:00
Mark
b051f39145 correct peek_byte/2 bugs (#1882) 2023-07-13 12:23:20 -06:00
Mark
cfc49243c8 improve ground/1 performance (#1389) 2023-07-12 18:11:56 -06:00
Mark
29430ec88b fix peek_byte/2 crash (#1882) 2023-07-12 16:34:11 -06:00
Mark Thom
d520046a4f Merge pull request #1878 from mthom/lookahead_indexing
use lookahead to skip inapplicable clauses (#1028, #1502)
2023-07-12 16:21:06 -06:00
Markus Triska
814ce2d672 ENHANCED: improved determinism of member/2
Example:

    ?- member(X, "abc").
    %@    X = a
    %@ ;  X = b
    %@ ;  X = c.

This addresses #750.
2023-07-12 14:39:08 -06:00
Mark
4fd37335f5 use lookahead to skip inapplicable clauses (#1028, #1502) 2023-07-12 14:39:02 -06:00