mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-05-01 17:24:34 +00:00
Estimated hours taken: 14 Branches: main Change the compiler and tools so that `.' and not `:' is now used as the module separator in all output. Infix `.' now has associativity yfx and priority 10. NEWS: Report the change. configure.in: Amend the test for an up-to-date Mercury compiler to check whether it recognises `.' as a module qualifier. compiler/code_gen.m: compiler/error_util.m: compiler/hlds_out.m: compiler/prog_out.m: compiler/prog_util.m: compiler/rl_exprn.m: compiler/rl_gen.m: compiler/source_file_map.m: compiler/unused_args.m: library/io.m: library/rtti_implementation.m: library/type_desc.m: runtime/mercury_debug.c: runtime/mercury_deconstruct.c: runtime/mercury_stack_trace.c: Change `:' to `.' as module separator for output. compiler/mercury_to_mercury.m: compiler/prog_io_typeclass.m: As above. Fixed a bug where `.' was not being recognised as a module separator. doc/reference_manual.texi: Report the change. library/term_io.m: Ensure that infix `.' is written without surrounding spaces. tests/hard_coded/dot_separator.m: tests/hard_coded/dot_separator.exp: tests/hard_coded/Mmakefile: Test case added.
139 lines
6.4 KiB
Plaintext
139 lines
6.4 KiB
Plaintext
1: 1 1 CALL pred interactive.main/2-0 (cc_multi) interactive.m:21
|
|
mdb> echo on
|
|
Command echo enabled.
|
|
mdb> query interactive list
|
|
?- append(X, Y, ['a', 'b', 'c']).
|
|
<stdin>:026: Inferred :- pred query((list.list(character)), (list.list(character))).
|
|
<stdin>:026: Inferred :- mode query(out, out) is multi.
|
|
X = [], Y = ['a', 'b', 'c'], true ;
|
|
X = ['a'], Y = ['b', 'c'], true ;
|
|
X = ['a', 'b'], Y = ['c'], true ;
|
|
X = ['a', 'b', 'c'], Y = [], true ;
|
|
fail.
|
|
No (more) solutions.
|
|
?- qperm([1,2,3], List).
|
|
<stdin>:026: Inferred :- pred query((list.list(int))).
|
|
<stdin>:026: Inferred :- mode query(out) is nondet.
|
|
List = [1, 2, 3], true ;
|
|
List = [1, 3, 2], true ;
|
|
List = [2, 1, 3], true ;
|
|
List = [2, 3, 1], true ;
|
|
List = [3, 1, 2], true ;
|
|
List = [3, 2, 1], true ;
|
|
fail.
|
|
No (more) solutions.
|
|
?- qperm([1,2,3], List), List = [2 | _].
|
|
<stdin>:012: In clause for predicate `mdb_query.run/2':
|
|
<stdin>:012: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:014: In clause for predicate `mdb_query.run/2':
|
|
<stdin>:014: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:012: In clause for predicate `mdb_query.run/2':
|
|
<stdin>:012: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:015: In clause for predicate `mdb_query.run/2':
|
|
<stdin>:015: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:026: In clause for predicate `mdb_query.query/2':
|
|
<stdin>:026: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:001: In clause for predicate `mdb_query.query/2':
|
|
<stdin>:001: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:026: Inferred :- pred query((list.list(int)), (list.list(int))).
|
|
<stdin>:026: Inferred :- mode query(out, out) is nondet.
|
|
List = [2, 1, 3], _2 = [1, 3], true ;
|
|
List = [2, 3, 1], _2 = [3, 1], true ;
|
|
fail.
|
|
No (more) solutions.
|
|
?- qperm([1,2,3], List), List = [4 | _].
|
|
<stdin>:012: In clause for predicate `mdb_query.run/2':
|
|
<stdin>:012: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:014: In clause for predicate `mdb_query.run/2':
|
|
<stdin>:014: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:012: In clause for predicate `mdb_query.run/2':
|
|
<stdin>:012: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:015: In clause for predicate `mdb_query.run/2':
|
|
<stdin>:015: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:026: In clause for predicate `mdb_query.query/2':
|
|
<stdin>:026: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:001: In clause for predicate `mdb_query.query/2':
|
|
<stdin>:001: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:026: Inferred :- pred query((list.list(int)), (list.list(int))).
|
|
<stdin>:026: Inferred :- mode query(out, out) is nondet.
|
|
fail.
|
|
No (more) solutions.
|
|
?- qperm([1,2,"foo"], List).
|
|
<stdin>:001: In clause for predicate `mdb_query.query/1':
|
|
<stdin>:001: in argument 1 of call to predicate `qperm/2':
|
|
<stdin>:001: in argument 2 of functor `[|]/2':
|
|
<stdin>:001: in argument 2 of functor `[|]/2':
|
|
<stdin>:001: in argument 1 of functor `[|]/2':
|
|
<stdin>:001: type error in unification of argument
|
|
<stdin>:001: and constant `"foo"'.
|
|
<stdin>:001: argument has type `int',
|
|
<stdin>:001: constant `"foo"' has type `string'.
|
|
For more information, try recompiling with `-E'.
|
|
Compilation error(s) occurred.
|
|
?- qperm(List, [1]).
|
|
<stdin>:026: Inferred :- pred query((list.list(int))).
|
|
<stdin>:014: In clause for `run(di, uo)':
|
|
<stdin>:014: in call to predicate `mdb_query.query/1':
|
|
<stdin>:014: mode error: arguments `List'
|
|
<stdin>:014: have insts `free',
|
|
<stdin>:014: which does not match any of the valid modes for
|
|
<stdin>:014: the callee, because of the following error.
|
|
<stdin>:026: In clause for `query(out(not_reached))':
|
|
<stdin>:026: in argument 1 of call to predicate `interactive.qperm/2':
|
|
<stdin>:026: mode error: variable `HeadVar__2' has instantiatedness `free',
|
|
<stdin>:026: expected instantiatedness was `ground'.
|
|
For more information, try recompiling with `-E'.
|
|
Compilation error(s) occurred.
|
|
?- quit.
|
|
|
|
mdb> cc_query interactive list
|
|
?- append(X, Y, ['a', 'b', 'c']).
|
|
<stdin>:017: Inferred :- pred query((list.list(character)), (list.list(character))).
|
|
<stdin>:017: Inferred :- mode query(out, out) is multi.
|
|
X = [], Y = ['a', 'b', 'c'], true.
|
|
?- qperm([1,2,3], List).
|
|
<stdin>:017: Inferred :- pred query((list.list(int))).
|
|
<stdin>:017: Inferred :- mode query(out) is nondet.
|
|
List = [1, 2, 3], true.
|
|
?- qperm([1,2,3], List), List = [2 | _].
|
|
<stdin>:011: In clause for predicate `mdb_query.run/2':
|
|
<stdin>:011: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:012: In clause for predicate `mdb_query.run/2':
|
|
<stdin>:012: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:017: In clause for predicate `mdb_query.query/2':
|
|
<stdin>:017: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:001: In clause for predicate `mdb_query.query/2':
|
|
<stdin>:001: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:017: Inferred :- pred query((list.list(int)), (list.list(int))).
|
|
<stdin>:017: Inferred :- mode query(out, out) is nondet.
|
|
List = [2, 1, 3], _2 = [1, 3], true.
|
|
?- qperm([1,2,3], List), List = [4 | _].
|
|
<stdin>:011: In clause for predicate `mdb_query.run/2':
|
|
<stdin>:011: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:012: In clause for predicate `mdb_query.run/2':
|
|
<stdin>:012: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:017: In clause for predicate `mdb_query.query/2':
|
|
<stdin>:017: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:001: In clause for predicate `mdb_query.query/2':
|
|
<stdin>:001: warning: variable `_2' occurs more than once in this scope.
|
|
<stdin>:017: Inferred :- pred query((list.list(int)), (list.list(int))).
|
|
<stdin>:017: Inferred :- mode query(out, out) is nondet.
|
|
No solution.
|
|
?- quit.
|
|
|
|
mdb> io_query interactive list
|
|
run <-- main.
|
|
[1, 3, 5, 2, 4]
|
|
run <-- if { append(X, Y, ['a', 'b', 'c']) } then print("X = "), print(X), print(", Y = "), print(Y), nl else print("No solution\n").
|
|
X = [], Y = ['a', 'b', 'c']
|
|
run <-- if { qperm([1,2,3], List) } then print(List), nl else [].
|
|
[1, 2, 3]
|
|
run <-- if { qperm([1,2,3], List), List = [2 | _] } then print(List), nl else { true }.
|
|
[2, 1, 3]
|
|
run <-- if { qperm([1,2,3], List), List = [4 | _] } then print(List), nl else print("No solution, as expected."), io__nl.
|
|
No solution, as expected.
|
|
run <-- quit.
|
|
|
|
mdb> continue -n -S
|
|
[1, 3, 5, 2, 4]
|